-
-
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
fix(python): Ensure the cs.temporal()
selector uses wildcard time zone matching for Datetime
#13683
fix(python): Ensure the cs.temporal()
selector uses wildcard time zone matching for Datetime
#13683
Conversation
cs.temporal()
selector wildcards Datetime the time_zone matchcs.temporal()
selector wildcards Datetime
time zone matches
138f672
to
f3e2b94
Compare
cs.temporal()
selector wildcards Datetime
time zone matchescs.temporal()
selector uses wildcard time zone matching for Datetime
2df8f7d
to
1d6f359
Compare
I don't know about this as |
I did think about this, but if you're using a Having said all that, ideally you'd be using a |
I don't really know what you mean by matching - If you mean matching by using the special |
eg: But I don't mind having the wildcard logic live only in |
If those data type groups were internal I would be fine with it, but they are part of the public API (which I am not too sure about actually). So they shouldn't contain invalid types just because we need that in our internal logic. No user can really do anything with a |
Indeed; but my contention is that the majority use-case for Though... perhaps we should be pushing people towards selectors for this use-case, and eventually deprecate type-matching inside |
This might be a somewhat wonky suggestion, but what if we were to distinguish a generic class Datetime:
_tz_supplied = False
__marker = object()
def __init__(time_unit=None, time_zone=__marker):
self._tz_supplied = time_zone is __marker ...or something of the sort. |
1d6f359
to
64f13ba
Compare
I think a wildcard is quite nice here - |
This change would help me a lot in some queries, as most of my datetime columns have TZ, thanks for fixing the issue! Is there any blocker to get this merged? |
64f13ba
to
0fc5009
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13683 +/- ##
==========================================
- Coverage 81.24% 81.06% -0.19%
==========================================
Files 1348 1322 -26
Lines 175304 171366 -3938
Branches 2509 2461 -48
==========================================
- Hits 142425 138912 -3513
+ Misses 32399 31984 -415
+ Partials 480 470 -10 ☔ 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.
I really want to avoid adding these "NO_WILDCARD" constants to the public API. I feel like we have to rethink things a bit more thoroughly and I don't want to add more stuff that we might have to deprecate later.
Let's just restore the DATETIME_DTYPES
variable and explicitly specify the dtypes in that one parametric test, and then we can revisit this later.
0fc5009
to
a4762c2
Compare
cs.temporal()
selector uses wildcard time zone matching for Datetime
cs.temporal()
selector uses wildcard time zone matching for Datetime
Closes #13665.
We weren't matching
Datetime
dtypes with time zones when using thecs.temporal()
selector (orDATETIME_DTYPES
andTEMPORAL_DTYPES
dtype sets). Ensuring the match additionally uses thetime_zone="*"
wildcard fixes this.Example
Before: (missing datetime dtypes that have timezones)
After: (all datetime dtypes selected)