{"record":{"id":"4b01bfa7be402ba4","repo":"apache/superset","slug":"parsing-error-error-s","errorCode":null,"errorMessage":"Parsing error: %(error)s","messagePattern":"Parsing error: (.+?)","errorType":"exception","errorClass":"DatabaseUploadFailed","httpStatus":422,"severity":"error","filePath":"superset/commands/database/uploaders/columnar_reader.py","lineNumber":70,"sourceCode":"        super().__init__(\n            options=dict(options),\n        )\n\n    def _read_buffer_to_dataframe(self, buffer: IO[bytes]) -> pd.DataFrame:\n        kwargs: dict[str, Any] = {\n            \"path\": buffer,\n        }\n        if self._options.get(\"columns_read\"):\n            kwargs[\"columns\"] = self._options.get(\"columns_read\")\n        try:\n            return pd.read_parquet(**kwargs)\n        except (\n            pd.errors.ParserError,\n            pd.errors.EmptyDataError,\n            UnicodeDecodeError,\n            ValueError,\n        ) as ex:\n            raise DatabaseUploadFailed(\n                message=_(\"Parsing error: %(error)s\", error=str(ex))\n            ) from ex\n        except Exception as ex:\n            raise DatabaseUploadFailed(_(\"Error reading Columnar file\")) from ex\n\n    @staticmethod\n    def _yield_files(file: FileStorage) -> Generator[IO[bytes], None, None]:\n        \"\"\"\n        Yields files from the provided file. If the file is a zip file, it yields each\n        file within the zip file. If it's a single file, it yields the file itself.\n\n        :param file: The file to yield files from.\n        :return: A generator that yields files.\n        \"\"\"\n        file_suffix = Path(file.filename).suffix\n        if not file_suffix:\n            raise DatabaseUploadFailed(_(\"Unexpected no file extension found\"))\n        file_suffix = file_suffix[1:]  # remove the dot","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/database/uploaders/columnar_reader.py#L52-L88","documentation":"Raised as DatabaseUploadFailed with message 'Parsing error: <detail>' when pd.read_parquet fails with a recognized parsing exception (pd.errors.ParserError, pd.errors.EmptyDataError, UnicodeDecodeError, or ValueError) while converting an uploaded Parquet buffer to a DataFrame in ColumnarReader._read_buffer_to_dataframe. The underlying pandas/pyarrow message is embedded so the user sees the actual cause (e.g. 'Invalid parquet file', 'No columns to parse from file').","triggerScenarios":"Uploading a Parquet file that is truncated/corrupt, empty (0 rows or empty file inside a ZIP), or not actually Parquet (e.g. a renamed CSV) via the Superset database 'Upload file to table' flow with the Columnar reader; also when a selected column in 'columns_read' does not exist in the file, causing pyarrow to raise ValueError.","commonSituations":"File truncated during transfer or HTTP upload size limits; picking arbitrary files from a ZIP where one entry is a __MACOSX metadata file or a non-parquet payload; specifying column names with trailing whitespace or wrong case in the column selection UI; Parquet files written by an incompatible/older pyarrow version.","solutions":["Open the file locally with pandas/pyarrow (pd.read_parquet) to reproduce the exact underlying error shown in %(error)s","If a column filter was set, verify every name in columns_read matches the file schema exactly (case and whitespace)","If uploaded inside a ZIP, confirm every entry is a valid Parquet file; re-zip without OS metadata directories","Regenerate or re-upload the file; if it was truncated, check client-side upload limits (e.g. nginx client_max_body_size, Flask MAX_CONTENT_LENGTH)"],"exampleFix":"# before: uploading a zip containing 'data.parquet' and '__MACOSX/._data.parquet'\n# after: zip only the parquet payload\nzip clean.zip data.parquet  # single entry, valid parquet","handlingStrategy":"validation","validationCode":"import pyarrow.parquet as pq\n\ndef parquet_is_readable(fh) -> bool:\n    try:\n        fh.seek(0)\n        pq.ParquetFile(fh).metadata  # noqa: force footer parse\n        return True\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"from superset.commands.database.exceptions import DatabaseUploadFailed\ntry:\n    reader.file_to_dataframe(file)\nexcept DatabaseUploadFailed as ex:\n    # message embeds the pandas/pyarrow cause\n    logger.warning(\"parquet upload failed: %s\", ex.message)  # surface to user, keep chained cause","preventionTips":["Pre-parse Parquet files with pyarrow before uploading","Keep ZIP archives single-type and free of OS metadata entries","Match 'columns to read' names exactly to the file schema"],"tags":["parquet","pandas","file-upload","data-ingestion"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}