Skip to content
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

Refactor and improve CSV adapter #96

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Refactor and improve CSV adapter #96

merged 2 commits into from
Nov 20, 2023

Conversation

yunzheng
Copy link
Member

@yunzheng yunzheng commented Nov 16, 2023

This change allows the CSV adapter to:

  • properly read reserved field names (eg: _generated, _source, etc)
  • use clean_fieldname that otherwise are invalid names in flow.record
  • deduce format of csv file automatically by using csv.Sniffer

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (64263bc) 80.00% compared to head (131caad) 80.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
+ Coverage   80.00%   80.06%   +0.05%     
==========================================
  Files          33       33              
  Lines        3101     3110       +9     
==========================================
+ Hits         2481     2490       +9     
  Misses        620      620              
Flag Coverage Δ
unittests 80.06% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@yunzheng yunzheng marked this pull request as draft November 17, 2023 08:26
This change allows the CSV adapter to:
 - ability to read reserved fields (eg: _generated, _source, etc)
 - use `normalize_fieldname` to normalize field names in flow.record
 - deduce format of csv file automatically by using `csv.Sniffer`
@yunzheng yunzheng marked this pull request as ready for review November 17, 2023 21:20
Schamper
Schamper previously approved these changes Nov 18, 2023
flow/record/base.py Show resolved Hide resolved
@yunzheng yunzheng merged commit 676d61c into main Nov 20, 2023
28 of 32 checks passed
@yunzheng yunzheng deleted the refactor/csv-adapter branch November 20, 2023 13:53
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.

None yet

2 participants