{"record":{"id":"fd046a65af68c530","repo":"pandas-dev/pandas","slug":"freq-is-not-supported","errorCode":null,"errorMessage":"{freq=} is not supported","messagePattern":"(.+?) is not supported","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pandas/core/arrays/arrow/array.py","lineNumber":4224,"sourceCode":"        pa_supported_unit = {\n            \"Y\": \"year\",\n            \"YS\": \"year\",\n            \"Q\": \"quarter\",\n            \"QS\": \"quarter\",\n            \"M\": \"month\",\n            \"MS\": \"month\",\n            \"W\": \"week\",\n            \"D\": \"day\",\n            \"h\": \"hour\",\n            \"min\": \"minute\",\n            \"s\": \"second\",\n            \"ms\": \"millisecond\",\n            \"us\": \"microsecond\",\n            \"ns\": \"nanosecond\",\n        }\n        unit = pa_supported_unit.get(offset._prefix, None)\n        if unit is None:\n            raise ValueError(f\"{freq=} is not supported\")\n        multiple = offset.n\n        rounding_method = getattr(pc, f\"{method}_temporal\")\n        result = rounding_method(self._pa_array, multiple=multiple, unit=unit)\n        return self._from_pyarrow_array(result)\n\n    def _dt_ceil(\n        self,\n        freq,\n        ambiguous: TimeAmbiguous = \"raise\",\n        nonexistent: TimeNonexistent = \"raise\",\n    ) -> Self:\n        return self._round_temporally(\"ceil\", freq, ambiguous, nonexistent)\n\n    def _dt_floor(\n        self,\n        freq,\n        ambiguous: TimeAmbiguous = \"raise\",\n        nonexistent: TimeNonexistent = \"raise\",","sourceCodeStart":4206,"sourceCodeEnd":4242,"githubUrl":"https://github.com/pandas-dev/pandas/blob/3b7651241d4da534b3559b60ef128e1c34f54116/pandas/core/arrays/arrow/array.py#L4206-L4242","documentation":"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.","triggerScenarios":"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.","commonSituations":"Using business/semiannual frequencies that work fine on datetime64[ns] but are unimplemented on the pyarrow rounding path.","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."],"exampleFix":"# before\nser.dt.floor('B')\n# after\nser.astype('datetime64[ns]').dt.floor('B')","handlingStrategy":"validation","validationCode":"from pandas.tseries.frequencies import to_offset\nSUPPORTED = {'Y','YS','Q','QS','M','MS','W','D','h','min','s','ms','us','ns'}\noff = to_offset(freq)\nif off is None or off._prefix not in SUPPORTED:\n    raise ValueError(f\"{freq!r} unsupported on arrow rounding\")\nser.dt.floor(freq)","typeGuard":"def is_arrow_supported_freq(freq) -> bool:\n    from pandas.tseries.frequencies import to_offset\n    off = to_offset(freq)\n    return off is not None and off._prefix in {'Y','YS','Q','QS','M','MS','W','D','h','min','s','ms','us','ns'}","tryCatchPattern":"try:\n    out = ser.dt.floor(freq)\nexcept ValueError as e:\n    if \"is not supported\" in str(e):\n        out = ser.astype('datetime64[ns]').dt.floor(freq)\n    else:\n        raise","preventionTips":["Avoid business/semi offsets in arrow rounding","Fall back to datetime64[ns] for unsupported offsets"],"tags":["pyarrow","datetime-accessor","frequency","arrow-extension"],"backgroundTag":null,"analyzedSha":"3b7651241d4da534b3559b60ef128e1c34f54116","analyzedAt":"2026-08-11T22:10:44.015Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}