ildipo opened a new issue, #35730:
URL: https://github.com/apache/arrow/issues/35730

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   When writing a table whose schema has nullable columns using write_dataset 
the nullable info is not saved
   
   To reproduce
   
   ```
   import pyarrow as pa
   import pyarrow.parquet as pq
   import datetime as dt
   import pyarrow.dataset as ds
   
   table = pa.Table.from_arrays([[1,2,3],[None,5,None], [dt.date(2023,1,1), 
dt.date(2023,1,2), dt.date(2023,1,3)]],
       schema=pa.schema([pa.field("x", pa.int64(), nullable=False), 
pa.field("y", pa.int64(), nullable=True), pa.field("date", pa.date32(), 
nullable=True)]))
   print(table.schema)
   # schema shows  column 'x' as not nullable
   
   pq.write_to_dataset(table, parquet_test1", partitioning=['date'], 
partitioning_flavor='hive')
   dataset = ds.dataset("parquet_test1", format="parquet", partitioning="hive")
   dataset.to_table().schema
   # column 'x' is nullable
   
   pa.dataset.write_dataset(table, "parquet_test2", partitioning=['date'], 
partitioning_flavor='hive', format='parquet')
   dataset = ds.dataset("parquet_test2", format="parquet", partitioning="hive")
   dataset.to_table().schema
   # column 'x' is nullable
   
   ```
   
   
   
   ### Component(s)
   
   Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to