pandas-dev/pandas · error · ValueError
is not supported
Error message
{freq=} is not supported What it means
Raised by ArrowExtensionArray._round_temporally when the offset parses successfully but its `_prefix` is not in the allow-list of units pyarrow's round_temporal supports (year, quarter, month, week, day, hour, minute, second, milli/micro/nanosecond). Examples of unsupported prefixes include business-day ('B'), semi-annual ('2QS' style edges), and custom/business offsets.
Solutions
- Use a supported base frequency (D, h, min, s, ms, us, ns, W, M, Q, Y) on the arrow column.
- Cast to datetime64[ns] (`ser.astype('datetime64[ns]')`) and round there, where business offsets are supported.
Example fix
# before
ser.dt.floor('B')
# after
ser.astype('datetime64[ns]').dt.floor('B') Defensive patterns
Strategy: validation
Validate before calling
from pandas.tseries.frequencies import to_offset
SUPPORTED = {'Y','YS','Q','QS','M','MS','W','D','h','min','s','ms','us','ns'}
off = to_offset(freq)
if off is None or off._prefix not in SUPPORTED:
raise ValueError(f"{freq!r} unsupported on arrow rounding")
ser.dt.floor(freq) Type guard
def is_arrow_supported_freq(freq) -> bool:
from pandas.tseries.frequencies import to_offset
off = to_offset(freq)
return off is not None and off._prefix in {'Y','YS','Q','QS','M','MS','W','D','h','min','s','ms','us','ns'} Try / catch
try:
out = ser.dt.floor(freq)
except ValueError as e:
if "is not supported" in str(e):
out = ser.astype('datetime64[ns]').dt.floor(freq)
else:
raise Prevention
- Avoid business/semi offsets in arrow rounding
- Fall back to datetime64[ns] for unsupported offsets
When it happens
Trigger: Calling `.dt.floor('B')` (business day), `.dt.ceil('SM')` (semi-month), or any custom BusinessHour/CustomBusinessDay offset on a timestamp[pyarrow] Series. `to_offset` returns a real offset, but `pa_supported_unit.get(offset._prefix)` is None.
Common situations: Using business/semiannual frequencies that work fine on datetime64[ns] but are unimplemented on the pyarrow rounding path.
Related errors
- Must specify a valid frequency
- ambiguous is not supported.
- is not supported
- as_unit not implemented for
- Cannot convert tz-naive timestamps, use tz_localize to…
AI-assisted analysis of pandas-dev/pandas@3b7651241d (2026-08-11).
Data as JSON: /api/errors/fd046a65af68c530.
Report an issue: GitHub.
Appendix: source
Thrown at pandas/core/arrays/arrow/array.py:4224
pa_supported_unit = {
"Y": "year",
"YS": "year",
"Q": "quarter",
"QS": "quarter",
"M": "month",
"MS": "month",
"W": "week",
"D": "day",
"h": "hour",
"min": "minute",
"s": "second",
"ms": "millisecond",
"us": "microsecond",
"ns": "nanosecond",
}
unit = pa_supported_unit.get(offset._prefix, None)
if unit is None:
raise ValueError(f"{freq=} is not supported")
multiple = offset.n
rounding_method = getattr(pc, f"{method}_temporal")
result = rounding_method(self._pa_array, multiple=multiple, unit=unit)
return self._from_pyarrow_array(result)
def _dt_ceil(
self,
freq,
ambiguous: TimeAmbiguous = "raise",
nonexistent: TimeNonexistent = "raise",
) -> Self:
return self._round_temporally("ceil", freq, ambiguous, nonexistent)
def _dt_floor(
self,
freq,
ambiguous: TimeAmbiguous = "raise",
nonexistent: TimeNonexistent = "raise",View on GitHub (pinned to 3b7651241d)