Skip to content

API: Timestamp positional arguments not aligned with datetime.datetime #32526

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

Closed
mroeschke opened this issue Mar 7, 2020 · 5 comments · Fixed by #50545
Closed

API: Timestamp positional arguments not aligned with datetime.datetime #32526

mroeschke opened this issue Mar 7, 2020 · 5 comments · Fixed by #50545
Labels
API - Consistency Internal Consistency of API/Behavior Bug Datetime Datetime data dtype

Comments

@mroeschke
Copy link
Member

Our Timestamp constructor is not positionally aligned with datetime.datetime since we support a nanosecond argument which comes in between microsecond and tzinfo.

This is the main cause for #32174 as dispatching to datetime.datetime methods sometimes reconstructs Timestamp with positional arguments.

nanosecond should be moved to the last positional argument in the Timestamp constructor.

@mroeschke mroeschke added the Datetime Datetime data dtype label Mar 7, 2020
@shang-vikas
Copy link

Hi @mroeschke , i would like to take this up.

@mroeschke
Copy link
Member Author

Great @shang-vikas! This will involve a deprecation cycle as moving the position of the nanosecond argument would be a breaking API change.

@jbrockmendel
Copy link
Member

is this closed by #49416?

@mroeschke
Copy link
Member Author

Might not have been fully closed by #49416. According to test_constructor_nanosecond looks like nanosecond is still accepted positionally when in #49416 it was supposed to be keyword only?

@jbrockmendel
Copy link
Member

Huh. The signature in Timestamp.__new__ looks like nanosecond should be keyword only. Might be a cython issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants