OpenMetadata
OpenMetadata copied to clipboard
CSV Parsing Error When Escape Character Is Followed by a Comma
Affected module: Ingestion
Describe the bug
We are encountering a CSV parsing error when a field value contains an escaped double quote followed by a comma, for example, "my value \", new". The parser incorrectly interprets the comma as a field separator instead of part of the quoted value, causing the row to be parsed with an extra column.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/metadata/utils/datalake/datalake_utils.py", line 62, in fetch_dataframe
df_wrapper: DatalakeColumnWrapper = df_reader.read(
File "/usr/local/lib/python3.10/site-packages/metadata/readers/dataframe/base.py", line 73, in read
raise DataFrameReadException(f"Error reading dataframe due to [{err}]")
metadata.readers.dataframe.base.DataFrameReadException: Error reading dataframe due to [Error tokenizing data. C error: Expected 90 fields in line 32828, saw 91
]
[2026-02-05 07:10:13] ERROR {metadata.Utils:datalake_utils:70} - Error fetching file [raw-dgrg/cmic/full_load/PMPROJECTITEM_TN/2026-01-07/PMPROJECTITEM_TN.csv] using [AzureConfig] due to: [Error reading dataframe due to [Error tokenizing data. C error: Expected 90 fields in line 32828, saw 91
]]
To Reproduce
Screenshots or steps to reproduce
Expected behavior The CSV parser should correctly interpret the value as a single column value, treating the escaped double quote and the comma as part of the field content, and parse the row without any column count mismatch or ingestion failure.
Version:
- OS: [e.g. iOS]
- Python version:
- OpenMetadata version: [e.g. 0.8]
- OpenMetadata Ingestion package version: [e.g.
openmetadata-ingestion[docker]==XYZ]
Additional context Add any other context about the problem here.