From 485e666abcfede7da44583575773749c13b3b760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Sat, 18 Jan 2025 18:22:52 +0100 Subject: [PATCH] cast type to PDDatetimeUnitOptions --- xarray/coding/times.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xarray/coding/times.py b/xarray/coding/times.py index 0f9a7a48ef8..fd99a55a2a2 100644 --- a/xarray/coding/times.py +++ b/xarray/coding/times.py @@ -595,7 +595,9 @@ def _numbers_to_timedelta( # estimate fitting resolution for floating point values # this iterates until all floats are fractionless or time_unit == "ns" if flat_num.dtype.kind == "f" and time_unit != "ns": - flat_num, new_time_unit = _check_higher_resolution(flat_num, time_unit) + flat_num, new_time_unit = _check_higher_resolution( + flat_num, cast(PDDatetimeUnitOptions, time_unit) + ) if time_unit != new_time_unit: msg = ( f"Can't decode floating point {datatype} to {time_unit!r} without " pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy