Skip to content

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

Closed
@mroeschke

Description

@mroeschke

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.

Activity

shang-vikas

shang-vikas commented on Mar 9, 2020

@shang-vikas

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

mroeschke

mroeschke commented on Mar 9, 2020

@mroeschke
MemberAuthor

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

jbrockmendel

jbrockmendel commented on Dec 29, 2022

@jbrockmendel
Member

is this closed by #49416?

mroeschke

mroeschke commented on Jan 3, 2023

@mroeschke
MemberAuthor

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

jbrockmendel commented on Jan 3, 2023

@jbrockmendel
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @jbrockmendel@mroeschke@shang-vikas

      Issue actions

        API: Timestamp positional arguments not aligned with datetime.datetime · Issue #32526 · pandas-dev/pandas