-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: datediff in datetime_parser #27368
Conversation
@@ -14,13 +14,14 @@ | |||
# KIND, either express or implied. See the License for the | |||
# specific language governing permissions and limitations | |||
# under the License. | |||
from __future__ import annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By catch, to use "new typing" rather than the old one.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #27368 +/- ##
==========================================
+ Coverage 69.61% 69.73% +0.12%
==========================================
Files 1908 1908
Lines 74543 74560 +17
Branches 8316 8316
==========================================
+ Hits 51895 51998 +103
+ Misses 20595 20509 -86
Partials 2053 2053
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Yongjie Zhao <[email protected]>
Co-authored-by: Yongjie Zhao <[email protected]>
Co-authored-by: Yongjie Zhao <[email protected]>
SUMMARY
The PR introduced a new function in date time expression that is
datediff(<from>, <to>, [time unit],)
, it returns a integer, so the return value should apply in thedateadd
function.The basic form is:
The
from
andto
parameter is able to be set any date time expression:The
datediff
also be indateadd
as a time deltaBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
The unit test was covered 100% cases.
ADDITIONAL INFORMATION