-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[WIP]: API ExtensionDtype for DTA & TDA #24674
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
Conversation
Still a WIP, but probably not going to have time to update this any further through the end of the week. |
return DatetimeArray | ||
|
||
@classmethod | ||
def construct_from_string(cls, string): |
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 think you need to move this to the sub-class as DatetimeDtype would actually accept this but raise on a construction error (as you can't pass a tz). I would maybe instead just have a unified constructor that accepts tz=None
for naive.
@jreback do you also mean just having a single class internally? I didn't really think about any possible technical implications of that, but it seems logical to me to do that, since we also have a single DatetimeArray. |
Sorry I put this up in haste and didn't explain things well. Initially, I tried that, but ran into some difficulties. It turns out that having I'm not sure if it's possible to both
but I can try (later, not today). |
yeah I think this is a great idea @TomAugspurger but also possibly to involve changing some tricky code; would prefer to push this to 0.25 |
The main downside with pushing to 0.25 is it'll be an API breaking change for just pushed an update, but still a WIP. |
Codecov Report
@@ Coverage Diff @@
## master #24674 +/- ##
==========================================
- Coverage 92.38% 92.36% -0.03%
==========================================
Files 166 166
Lines 52379 52474 +95
==========================================
+ Hits 48392 48467 +75
- Misses 3987 4007 +20
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24674 +/- ##
===========================================
- Coverage 92.38% 42.97% -49.42%
===========================================
Files 166 166
Lines 52366 52469 +103
===========================================
- Hits 48380 22550 -25830
- Misses 3986 29919 +25933
Continue to review full report at Codecov.
|
Somewhat awkward API corner: what's the expected types for
Previously, we'd use Another one, what should we do about NumPy doesn't make this easy, since they would raise if the operands were flipped, rather than returning NotImplemented. |
For the expected types, I also have been wondering about this in general. So eg also for |
Yeah, it's not obvious to me what's best here. On the one hand, you could say that On the other hand, is it weird for I'm really not sure what to do here :/ |
How about |
This has been inactive for a while. Still a goal? |
I'm not sure. The API changes are tricky to get right. Regardless, I don't think things will be done on this branch. I'll post an update on the issue. |
Closes #24662
TODO:
This is going to fail. Going offline for a bit, but putting this up right now.
I'm going to clean up the changes in
internals
and the series constructor.