egolearner commented on code in PR #49858:
URL: https://github.com/apache/arrow/pull/49858#discussion_r3278050063
##########
python/pyarrow/_dataset.pyx:
##########
@@ -2253,7 +2253,14 @@ cdef class CsvFileFormat(FileFormat):
"""
cdef CsvFileWriteOptions opts = \
<CsvFileWriteOptions> FileFormat.make_write_options(self)
- opts.write_options = WriteOptions(**kwargs)
+ # Start from the C++ defaults, which carry over fields from the
+ # format's parse_options (e.g. the delimiter), and apply caller
+ # overrides on top instead of replacing the WriteOptions object
+ # and discarding those defaults.
+ write_options = opts.write_options
+ for key, value in kwargs.items():
+ setattr(write_options, key, value)
Review Comment:
Restored behavior that None keeps the default. Changing `AttributeError` to
`TypeError` is unnecessary.
--
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]