Iterate until fitting resolution found.
(
flat_num_dates: np.ndarray,
time_unit: PDDatetimeUnitOptions,
)
| 456 | |
| 457 | |
| 458 | def _check_higher_resolution( |
| 459 | flat_num_dates: np.ndarray, |
| 460 | time_unit: PDDatetimeUnitOptions, |
| 461 | ) -> tuple[np.ndarray, PDDatetimeUnitOptions]: |
| 462 | """Iterate until fitting resolution found.""" |
| 463 | index = _ORDERED_PANDAS_TIME_RESOLUTIONS.index(time_unit) |
| 464 | new_units = _ORDERED_PANDAS_TIME_RESOLUTIONS[index:] |
| 465 | for new_time_unit in new_units: |
| 466 | if not ((np.unique(flat_num_dates % 1) > 0).any() and new_time_unit != "ns"): |
| 467 | break |
| 468 | flat_num_dates *= 1000 |
| 469 | return flat_num_dates, new_time_unit |
| 470 | |
| 471 | |
| 472 | def _decode_datetime_with_pandas( |
no test coverage detected
searching dependent graphs…