-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
API: Timestamp and Timedelta .value changing in 2.0 #49076
Comments
Probably least disruptive to have Personally, I was never fond of the vague meaning of |
The Arrow CI was failing because of this (in combination with the changes parsing of strings in It's a bit of a corner case (and so apparently also not covered by a test, since we didn't get a failure for this), but can be triggered by converting a list of Timestamp objects (or object dtype array), and explicitly passing a nanoseconds timestamp type:
This could be fixed on the pyarrow side by checking the unit of the Timestamp, and only using But it would break current pyarrow releases, so if we want to change So to summarize, I agree with the above that the easiest would be to keep But long term it would be good to have some way to get the raw underlying integer (that is more efficient that building up this value from the components, as we do for datetime.datetime objects). But this could indeed also be a method, as suggested by @mroeschke |
+1 on @mroeschke 's suggestion I'll work on |
Two bikeshed thoughts to what to use instead of |
For now, in #50891, I just made it I wasn't quite prepared for how many files it would involve changing |
@jorisvandenbossche @jbrockmendel @mroeschke are we sure this is a good idea? Because then the public-facing |
i guess we'd document that it is for nanos-only and direct users to use e.g. .asm8.view('i8') more generally |
sure, I'll add that to the error message
|
Timedelta supports non-nano, but doesn't do inference on strings |
thanks - how do I set it? I'm seeing
|
ah got it, nvm
|
In previous versions .value has always been in nanoseconds. By changing the reso we get with some Timestamp/Timedelta inputs, we change the .value, which is technically public API.
One option would be just to document the change in .value behavior along with the other breaking changes docs.
Another would be to use e.g.
._value
internally and keep.value
as representing nanos.The text was updated successfully, but these errors were encountered: