(
ref_date: pd.Timestamp, unit: NPDatetimeUnitOptions
)
| 431 | |
| 432 | |
| 433 | def _align_reference_date_and_unit( |
| 434 | ref_date: pd.Timestamp, unit: NPDatetimeUnitOptions |
| 435 | ) -> pd.Timestamp: |
| 436 | # align to the highest needed resolution of ref_date or unit |
| 437 | if np.timedelta64(1, ref_date.unit) > np.timedelta64(1, unit): |
| 438 | # this will raise accordingly |
| 439 | # if data can't be represented in the higher resolution |
| 440 | return timestamp_as_unit(ref_date, cast(PDDatetimeUnitOptions, unit)) |
| 441 | return ref_date |
| 442 | |
| 443 | |
| 444 | def _check_date_is_after_shift( |
no test coverage detected
searching dependent graphs…