-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
TimedeltaArray freq validation without _from_sequence #24723
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24723 +/- ##
===========================================
- Coverage 92.38% 43.07% -49.32%
===========================================
Files 166 166
Lines 52321 52344 +23
===========================================
- Hits 48337 22545 -25792
- Misses 3984 29799 +25815
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24723 +/- ##
==========================================
+ Coverage 92.38% 92.38% +<.01%
==========================================
Files 166 166
Lines 52321 52344 +23
==========================================
+ Hits 48337 48360 +23
Misses 3984 3984
Continue to review full report at Codecov.
|
Doing this for the RC? |
I would personally do that, but it might need some discussion with @jreback / @jbrockmendel ? |
Yeah. Though I'm also comfortable with doing this after the RC is tagged, but before 0.24.0. |
looks fine. @jbrockmendel |
I think let's just do this now. Apologies for ramming this through @jbrockmendel. |
No sweat; I'm eager to see the RC too. This does re-add a lot of redundant code. If the only objection to the previous implementation was that it let too many dtypes through, then just disallow those in the same line that disallowed np.bool_ |
Looking back at the discussion, I think other concerns were performance / the |
…v#24723) * TimedeltaArray freq validation without _from_sequence
…v#24723) * TimedeltaArray freq validation without _from_sequence
This aligns
TimedeltaArray.__init__
withDatetimeArray.__init__
, using the same approach how @jbrockmendel now handled the freq validation inDatetimeArray
in the merged #24686First commits removes usage of
from_sequence
(from #24666), second commit adds the freq validation as in #24686So related to the discussion at the end #24666 (and a partial revert of that). This makes the
TimedeltaArray
constructor again more restricted (only accepts correctly typed (int or timedelta64) containers.Until we decide on the constructors in general (#24684), I would prefer to keep them strict: it is always easier to later expand functionality (and then also test it), than remove functionality.