feat: Use csv.DictReader to parse header fields (msto#19)#20
Open
bostonrwalker wants to merge 1 commit intomsto:mainfrom
Open
feat: Use csv.DictReader to parse header fields (msto#19)#20bostonrwalker wants to merge 1 commit intomsto:mainfrom
bostonrwalker wants to merge 1 commit intomsto:mainfrom
Conversation
Owner
|
Thanks for the PR!
I’m OOO this week but will take a look next week. Bump this thread if you
don’t get a review by Wednesday
…On Wed, Nov 27, 2024 at 11:36 AM Boston Walker ***@***.***> wrote:
Used csv.DictReader() to do the dirty work because RFC4180 has lots of
tricky rules around quoting and special characters. Added a test to
demonstrate. Tested using Python 3.10, 3.11, and 3.12.
------------------------------
You can view, comment on, or merge this pull request online at:
#20
Commit Summary
- 4a9261d
<4a9261d>
feat: Use csv.DictReader to parse header fields (msto#19)
File Changes
(5 files <https://github.com/msto/dataclass_io/pull/20/files>)
- *M* dataclass_io/_lib/assertions.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-97aa5c3f1e48336161c15d79baa20e4fab0c41f1186130bdf3f01f4a342f2e54>
(5)
- *M* dataclass_io/_lib/file.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-16c13789c00ee4b2871a20f0f8be05e75fda0d236911b2727bfcd17bbd2471f2>
(11)
- *M* dataclass_io/reader.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-c69224ddcf5e4873be0f12e2527a3c225dff2a8af308ab52a9a636f503627c3f>
(7)
- *M* dataclass_io/writer.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-3ea12af2879db2dfd31bbc17a5f1207ea7912a6e67450cc34c089976f86f1903>
(4)
- *M* tests/test_reader.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-88ac3b584a5505d52ad940bf74289789a177ce60ae6852ba4d245b362612afd1>
(27)
Patch Links:
- https://github.com/msto/dataclass_io/pull/20.patch
- https://github.com/msto/dataclass_io/pull/20.diff
—
Reply to this email directly, view it on GitHub
<#20>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANOFNL2KOO3XXTZT7YCGT2CXYHHAVCNFSM6AAAAABSTIJ7XOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY4TSMJSGU4DKMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
msto
reviewed
Dec 8, 2024
Owner
msto
left a comment
There was a problem hiding this comment.
Hey, thanks again for the PR.
I think I should have initially included the dialect parameter in the Reader and Writer classes, and permitted other arguments such as quoting to be passed through as kwargs, similar to DictReader's interface.
https://docs.python.org/3/library/csv.html#csv.DictReader
Would there be any reasons to favor keeping quoting as an explicit argument if that change were made?
Author
|
I think I only included it for consistency. |
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Used csv.DictReader() to do the dirty work because RFC4180 has lots of tricky rules around quoting and special characters. Added a test to demonstrate. Tested using Python 3.10, 3.11, and 3.12.