Construct a numpy.datetime64 object through the pandas.Timestamp constructor with a specific resolution.
(unit: PDDatetimeUnitOptions, **kwargs)
| 65 | |
| 66 | |
| 67 | def _datetime64_via_timestamp(unit: PDDatetimeUnitOptions, **kwargs) -> np.datetime64: |
| 68 | """Construct a numpy.datetime64 object through the pandas.Timestamp |
| 69 | constructor with a specific resolution.""" |
| 70 | # TODO: when pandas 3 is our minimum requirement we will no longer need to |
| 71 | # convert to np.datetime64 values prior to passing to the DatetimeIndex |
| 72 | # constructor. With pandas < 3 the DatetimeIndex constructor does not |
| 73 | # infer the resolution from the resolution of the Timestamp values. |
| 74 | return pd.Timestamp(**kwargs).as_unit(unit).to_numpy() |
| 75 | |
| 76 | |
| 77 | @dataclass(init=False) |
nothing calls this directly
no test coverage detected
searching dependent graphs…