parquet conversion failed,Bool column has NA values in column boolean__v
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
I'm using the below code , while input data has boolean column with null and not null data however it's failing at the parquet conversion i'e "parquet conversion failed,Bool column has NA values in column boolean__v". kindly let me know what could be the issue
```
for chunk_number, chunk in enumerate(pd.read_csv(**read_csv_args), 1):
fields = []
for col,dtypes in sessionSchema.items():
fields.append(pa.field(col, dtypes, True)) # nullable=True, pass a DataFrame which in fact has nulls it appears the schema is ignored
glue_schema = pa.schema(fields)
table = pa.Table.from_pandas(chunk, preserve_index=False, schema=glue_schema)
if chunk_number == 1:
schema = table.schema
# Open a Parquet file for writing
pq_writer = pq.ParquetWriter(targetKey, schema, compression='snappy')
# Write CSV chunk to the parquet file
pq_writer.write_table(table)
```
Contributor guide
Research direction
Reproduce the reported failure with the pd.read_csv chunk loop, then trace pa.Table.from_pandas(..., schema=glue_schema) into pq.ParquetWriter.write_table. Done means a minimal reproduction and a confirmed explanation or fix for the nullable boolean conversion; the issue names no source file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100