fox-it / flow.record

Recordization library
GNU Affero General Public License v3.0
7 stars 9 forks source link

Support file-like objects in record writer #83

Closed MaxGroot closed 10 months ago

MaxGroot commented 11 months ago

Following https://github.com/fox-it/flow.record/pull/59, this Pull Request adds functionality for adapters of flow.record to write to file-like objects.

codecov[bot] commented 11 months ago

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%) :arrow_up:

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%) :arrow_up:

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

MaxGroot commented 11 months ago

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.