-
-
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
BUG: Series([ints], dtype=td[non-nano]) not respecting unit #52463
Conversation
@@ -2096,15 +2077,15 @@ def test_constructor_no_pandas_array(self, using_array_manager): | |||
|
|||
@td.skip_array_manager_invalid_test | |||
def test_from_array(self): | |||
result = Series(pd.array(["1H", "2H"], dtype="timedelta64[ns]")) | |||
result = Series(pd.array([1, 2], dtype="timedelta64[ns]")) |
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.
why do these need to change?
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.
This goes through array_to_timedelta64
seems not to handle string arguments if unit is specified. I suppose this makes sense since "1H" conflicts in unit with ns in the dtype
So I've had a branch aimed at this issue sitting on the backburner for a while now and been indecisive about how to handle this. In particular this makes |
I was thinking this qualified as a "bug fix" since we officially support non-nano units. |
would it be helpful if i pushed the WIP branch i mentioned to see if there is anything there worth cannibalizing? |
Definitely! With the test failures maybe the scope of this change is larger than I expected |
Not making much progress with this so closing for now |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.I think this should be backported since non-nano support is a new feature in 2.0