{"record":{"id":"b552d2a4ef59ffca","repo":"pola-rs/polars","slug":"orient-must-be-one-of-col-row-none-go","errorCode":null,"errorMessage":"`orient` must be one of {{'col', 'row', None}}, got {orient!r}","messagePattern":"`orient` must be one of (.+?)\\}, got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/_utils/construction/dataframe.py","lineNumber":638,"sourceCode":"    elif orient == \"col\":\n        column_names, schema_overrides = _unpack_schema(\n            schema, schema_overrides=schema_overrides, n_expected=len(data)\n        )\n        data_series: list[PySeries] = [\n            pl.Series(\n                column_names[i],\n                element,\n                dtype=schema_overrides.get(column_names[i]),\n                strict=strict,\n                nan_to_null=nan_to_null,\n            )._s\n            for i, element in enumerate(data)\n        ]\n        return PyDataFrame(data_series)\n\n    else:\n        msg = f\"`orient` must be one of {{'col', 'row', None}}, got {orient!r}\"\n        raise ValueError(msg)\n\n\ndef _sequence_of_series_to_pydf(\n    first_element: Series,  # noqa: ARG001\n    data: Sequence[Any],\n    schema: SchemaDefinition | None,\n    *,\n    schema_overrides: SchemaDict | None,\n    strict: bool,\n    **kwargs: Any,  # noqa: ARG001\n) -> PyDataFrame:\n    series_names = [s.name for s in data]\n    column_names, schema_overrides = _unpack_schema(\n        schema or series_names,\n        schema_overrides=schema_overrides,\n        n_expected=len(data),\n    )\n    data_series: list[PySeries] = []","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/py-polars/src/polars/_utils/construction/dataframe.py#L620-L656","documentation":"ValueError raised in the numpy-array construction path for DataFrames: the orient argument fell through the recognized branches ('col', 'row', None interpretation) and hit the terminal else. It is a sentinel guard reporting the unrecognized orient value so callers fix the orientation hint.","triggerScenarios":"Invalid orient argument to the DataFrame constructor.","commonSituations":"See trigger scenarios.","solutions":["Use orient='col', orient='row', or leave it as None."],"exampleFix":"pl.DataFrame(data, orient='row')","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"68506541d2de983056c9eb244e1ea05fab377dfc","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}