-
Notifications
You must be signed in to change notification settings - Fork 415
feat - add crlf support for csv exports #2783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat - add crlf support for csv exports #2783
Conversation
✅ Deploy Preview for dlt-hub-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2f817b5 to
462cee7
Compare
rudolfix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks pretty good! pls see my comments. thx for the tests!
dlt/common/data_writers/buffered.py
Outdated
| file_max_bytes: int = None, | ||
| disable_compression: bool = False, | ||
| _caps: DestinationCapabilitiesContext = None, | ||
| **writer_kwargs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see this used. do you need it for testing? We pass csv options via config injection (you do it correctly below)
|
@7amza79 please also fix linter: |
|
Hey @7amza79, would you like to continue working on this PR or you'd prefer that we take it from here? Thanks again for your effort! |
|
@burnash I 've noticed that pyArrow didn't support CRLF writing neither so I've "abandonned" working on this implementation and used pandas instead. So I think you can take it on from here if this "feature" is interesting for the product (which I think it is :D ) |
rudolfix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but maybe we could make lineterminator more flexible? see my comments. if you think it is not worth the effort you can also merge
Co-authored-by: Anton Burnashev <[email protected]>
Add CRLF Support for CSV Exports
Description
This PR adds support for Windows-style line endings (CRLF) in CSV exports, while maintaining the default UNIX-style line endings (LF). This enhancement improves compatibility with Windows-based systems and tools that expect CRLF line endings.
Changes
line_endingconfiguration option to CSV writers with two possible values:lf(default): Uses UNIX-style line endingscrlf: Uses Windows-style line endingsCsvWriterandArrowToCsvWriterto support line ending configurationTechnical Details
CsvLineEndingtype to configuration specsTesting
CsvWriterandArrowToCsvWriterDocumentation
line_endingoptionConfiguration Example
Or via environment variable:
Checklist