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

Support file-like objects in record writer #83

Conversation

MaxGroot
Copy link
Contributor

@MaxGroot MaxGroot commented Sep 14, 2023

Following #59, this Pull Request adds functionality for adapters of flow.record to write to file-like objects.

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #83 (4c8518a) into main (53c744b) will increase coverage by 0.06%.
The diff coverage is 78.12%.

@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   79.27%   79.34%   +0.06%     
==========================================
  Files          32       32              
  Lines        2939     2943       +4     
==========================================
+ Hits         2330     2335       +5     
+ Misses        609      608       -1     
Flag Coverage Δ
unittests 79.34% <78.12%> (+0.06%) ⬆️

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

Files Coverage Δ
flow/record/__init__.py 51.51% <ø> (ø)
flow/record/adapter/avro.py 79.27% <100.00%> (ø)
flow/record/adapter/jsonfile.py 98.21% <100.00%> (ø)
flow/record/adapter/line.py 100.00% <100.00%> (ø)
flow/record/adapter/stream.py 100.00% <100.00%> (ø)
flow/record/adapter/text.py 100.00% <100.00%> (ø)
flow/record/adapter/xlsx.py 0.00% <0.00%> (ø)
flow/record/base.py 90.85% <73.68%> (+0.26%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Schamper
Schamper previously approved these changes Sep 14, 2023
Copy link
Member

@yunzheng yunzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe open_file() should actually be called open_path_or_stream() as it's a wrapper around open_path and open_stream.

Do you also know why the test coverage went down so much?

flow/record/base.py Outdated Show resolved Hide resolved
flow/record/base.py Outdated Show resolved Hide resolved
@MaxGroot
Copy link
Contributor Author

Maybe open_file() should actually be called open_path_or_stream() as it's a wrapper around open_path and open_stream.

Do you also know why the test coverage went down so much?

I think the patch target checks coverage for changed lines, and for several adapters there are no tests yet. As I touched those lines they are taken into account when calculating the code coverage of the contribution.

Copy link
Member

@yunzheng yunzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yunzheng yunzheng force-pushed the improvement/support-file-like-objects-in-record-writer branch from c909b87 to 4c8518a Compare October 16, 2023 14:01
@yunzheng yunzheng merged commit ecbd912 into fox-it:main Oct 16, 2023
12 of 15 checks passed
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.

3 participants