Skip to content

BUG(?): Non nano + DatetOffset(component=0) re-infers resolution #57448

Open
@mroeschke

Description

In [1]: import pandas as pd; from io import StringIO; import numpy as np

In [2]: ser = pd.Series(pd.DatetimeIndex(["2000-01-01 00:00:00.012"], dtype="datetime64[ms]"))

In [3]: ser
Out[3]: 
0   2000-01-01 00:00:00.012
dtype: datetime64[ms]

In [4]: ser + pd.DateOffset(microseconds=0)  # 2.1.4
Out[4]: 
0   2000-01-01 00:00:00.012
dtype: datetime64[ms]

In [3]: ser + pd.DateOffset(microseconds=0). # main
Out[3]: 
0   2000-01-01 00:00:00.012
dtype: datetime64[us]

Possibly from #55595. Should the resolution be re-inferred here? cc @jbrockmendel

Metadata

Assignees

No one assigned

    Labels

    FrequencyDateOffsetsNon-Nanodatetime64/timedelta64 with non-nanosecond resolutionNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions