Skip to content

ISSUE 227: add parser_settings.debug flag and enable csv2 reader to optionally inject debug (line) info into record IDR. #228

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

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

jf-tech
Copy link
Owner

@jf-tech jf-tech commented Feb 21, 2025

Decided to make the debug flag a global setting in parser_settings and leave its type to be an int (>= 0) for future flexibility. Could've done with a string/enum to make it more defined and strict, but given it is an adv setting and current usage is so scarce thus leaving it flexible until further requirements arise.

For csv2 reader, if parser_settings.debug is 0 or omitted, which is the vast vast majority of existing and future csv2 schemas, no behavior changes; if parser_settings.debug isn't 0, then a __debug node will be added to the record IDR structure, underneath which, currently only line_num debug info will be added.

This design is flexible for all future adoptions in all other file format readers, yet has zero impact on any existing schemas.

issue #227

…to optionally inject debug (line) info into record IDR.

Decided to make the debug flag a global setting in `parser_settings` and leave its type to be an int (>= 0) for future
flexibility. Could've done with a string/enum to make it more defined and strict, but given it is an adv setting and current
usage is so scarce thus leaving it flexible until further requirements arise.

For `csv2` reader, if `parser_settings.debug` is 0 or omitted, which is the vast vast majority of existing and future `csv2`
schemas, no behavior changes; if `parser_settings.debug` isn't 0, then a `__debug` node will be added to the record IDR
structure, underneath which, currently only `line_num` debug info will be added.

This design is flexible for all future adoptions in all other file format readers, yet has zero impact on any existing
schemas.
@jf-tech jf-tech linked an issue Feb 21, 2025 that may be closed by this pull request
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (da04593) to head (64e49ca).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #228   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           53        53           
  Lines         3041      3052   +11     
=========================================
+ Hits          3041      3052   +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jf-tech jf-tech merged commit d4371ab into master Feb 21, 2025
3 checks passed
@jf-tech jf-tech deleted the debug_setting branch February 21, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get CSV row index
1 participant