{"record":{"id":"b8c5d489c8ecb48a","repo":"pandas-dev/pandas","slug":"nonexistent-is-not-supported","errorCode":null,"errorMessage":"nonexistent is not supported.","messagePattern":"nonexistent is not supported\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"pandas/core/arrays/arrow/array.py","lineNumber":4202,"sourceCode":"    def _dt_normalize(self) -> Self:\n        result = pc.floor_temporal(self._pa_array, 1, \"day\")\n        return self._from_pyarrow_array(result)\n\n    def _dt_strftime(self, format: str) -> Self:\n        result = pc.strftime(self._pa_array, format=format)\n        return self._from_pyarrow_array(result)\n\n    def _round_temporally(\n        self,\n        method: Literal[\"ceil\", \"floor\", \"round\"],\n        freq,\n        ambiguous: TimeAmbiguous = \"raise\",\n        nonexistent: TimeNonexistent = \"raise\",\n    ) -> Self:\n        if ambiguous != \"raise\":\n            raise NotImplementedError(\"ambiguous is not supported.\")\n        if nonexistent != \"raise\":\n            raise NotImplementedError(\"nonexistent is not supported.\")\n        offset = to_offset(freq)\n        if offset is None:\n            raise ValueError(f\"Must specify a valid frequency: {freq}\")\n        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\",","sourceCodeStart":4184,"sourceCodeEnd":4220,"githubUrl":"https://github.com/pandas-dev/pandas/blob/3b7651241d4da534b3559b60ef128e1c34f54116/pandas/core/arrays/arrow/array.py#L4184-L4220","documentation":"Raised by ArrowExtensionArray._round_temporally when the `nonexistent` argument is anything other than the default 'raise'. Temporal rounding delegates to pyarrow's round_temporal family, which has no parameter to resolve nonexistent (skipped-by-DST-forward) times, so 'shift_forward'/'shift_backward'/'NaT' cannot be honored during rounding.","triggerScenarios":"Calling `ser.dt.ceil('h', nonexistent='shift_forward')` (or any non-'raise' nonexistent value) on a timestamp[pyarrow] Series; the guard fires immediately regardless of whether the data actually contains a skipped time.","commonSituations":"Mirroring the nonexistent handling accepted by tz_localize into a ceil/floor/round call; spring-forward-DST data.","solutions":["Drop the `nonexistent` argument from the rounding call (use the default 'raise').","Handle non-existent times separately via tz_localize, which does support these strategies on the arrow path."],"exampleFix":"# before\nser.dt.ceil('h', nonexistent='shift_forward')\n# after\nser.dt.ceil('h')","handlingStrategy":"validation","validationCode":"if nonexistent != 'raise':\n    raise ValueError(\"nonexistent unsupported on arrow rounding; leave default\")\nser.dt.ceil('h')","typeGuard":"def arrow_round_accepts_nonexistent(nonexistent) -> bool:\n    return nonexistent == 'raise'","tryCatchPattern":"try:\n    out = ser.dt.ceil(freq, nonexistent=nonexistent)\nexcept NotImplementedError as e:\n    if \"nonexistent is not supported\" in str(e):\n        out = ser.dt.ceil(freq)\n    else:\n        raise","preventionTips":["Omit nonexistent kwarg from rounding calls on arrow dtypes","Handle nonexistent times in tz_localize instead"],"tags":["pyarrow","datetime-accessor","timezone","dst","not-implemented","arrow-extension"],"backgroundTag":null,"analyzedSha":"3b7651241d4da534b3559b60ef128e1c34f54116","analyzedAt":"2026-08-11T22:10:44.015Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}