-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
perf: Use direct path for time
/timedelta
literals
#18223
Conversation
Failures are deltalake, unrelated to PR. |
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.
I don't think the added tests actually cover the change 🤔 The existing Python pl.lit
already handles both types, your update enhances the lower-level Rust fn lit
(definitely worthwhile), but the tests look to be validating the existing functionality?
|
6d67eb2
to
a578ad3
Compare
CodSpeed Performance ReportMerging #18223 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #18223 +/- ##
==========================================
- Coverage 80.30% 80.22% -0.08%
==========================================
Files 1499 1500 +1
Lines 198744 198886 +142
Branches 2837 2837
==========================================
- Hits 159604 159561 -43
- Misses 38613 38798 +185
Partials 527 527 ☔ View full report in Codecov by Sentry. |
My failed test is an apparently rare hypothesis case; I'll open an issue, maybe @MarcoGorelli can take a look. Update: #18239. |
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.
Thanks. I think it is cleaner than our previous cast solution. Can you rebase, as we just moved the whole logic to a new crate, I doubt we can merge as is.
And there is a rogue print.
) { | ||
println!("here"); |
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.
rogue print
@ritchie46 I had rebased earlier. Just removed the print. Can you or @alexander-beedie verify that his concern is actually covered here? |
time(hour=23, minute=59, second=59, microsecond=999999), | ||
], | ||
) | ||
def test_literal_from_time(value: time) -> None: |
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.
These tests can be better. You should call explain(optimized=False)
and check there is no cast
in there.
See comment. The test would already pass without this PR. My suggestion would be better. |
@ritchie46 I added the check, but the test still passes on the main branch anyway. Any further suggestions? I think the fact that the test still works despite the PR should be enough, no? |
Yes, the IR conversion optimizes it away. So the test is not super useful. Let's remove the test and then merge. :P |
@ritchie46 removed the cast check. The |
Slight followup to #16018, allows direct construction of literals from
datetime.time
anddatetime.timedelta
objects.