Skip to content

Tick with normalize=True should be disallowed #21434

Closed
@jbrockmendel

Description

@jbrockmendel

See #21427

The issue is that a (non-Day) Tick object with normalize=True breaks addition monotonicity/associativity:

now = pd.Timestamp.now()
tick = pd.offsets.Minute(n=3, normalize=True)

>>> now
Timestamp('2018-06-11 17:38:10.135400')
>>> now + tick
Timestamp('2018-06-11 00:00:00')

>>> now + 64*tick + 64*tick
Timestamp('2018-06-11 00:00:00')
>>> now + 128*tick
Timestamp('2018-06-12 00:00:00')

The Day tick doesn't have the same problem, but I'd prefer to disallow it rather than make it a double-special-case. (See #20633 for more discussion about how Day should behave)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions