-
-
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
feat: Allow implicit string → temporal conversion in SQL comparisons #15958
feat: Allow implicit string → temporal conversion in SQL comparisons #15958
Conversation
Need to check/fix a few tests in the morning; parking in Draft in the meantime… Update: done. |
1835cea
to
9038533
Compare
9038533
to
c436282
Compare
I suppose this is not a specific to python? ( |
Quite right; brain clearly on autopilot there - fixed ;) |
2730afc
to
d2271db
Compare
CodSpeed Performance ReportMerging #15958 will not alter performanceComparing Summary
|
2e03128
to
65f27e2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15958 +/- ##
==========================================
- Coverage 80.98% 80.92% -0.06%
==========================================
Files 1386 1385 -1
Lines 178479 178277 -202
Branches 2877 3050 +173
==========================================
- Hits 144539 144276 -263
- Misses 33448 33514 +66
+ Partials 492 487 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Nice one @alexander-beedie. I've left some comments.
9924c82
to
7af4bfe
Compare
7af4bfe
to
86e7c7e
Compare
Closes #15956.
Where available, the internal active schema is now associated with
SQLExprVisitor
. This provides sufficient additional context for the binary comparison ops (and "IN" membership checks) to enable automatic temporal string casts (which PostgreSQL syntax allows).Handles comparison with bare column names (eg:
col > '2020-02-20'
) and cast expressions (eg:expr::date > '2020-02-20'
), which catches most typical usage. We should be able to enhance further as needed.Also:
Added
col::datetime
cast support (in addition to existingcol::timestamp
).Example