KEMBAR78
fix: Polars optional import by alespour · Pull Request #95 · InfluxCommunity/influxdb3-python · GitHub
Skip to content

Conversation

@alespour
Copy link
Contributor

@alespour alespour commented Jun 19, 2024

Closes #90

Proposed Changes

  • polars module is imported only when available and actually used
  • extracted PolarsDataFrameSerializer to a new file
  • added test for InfluxDBClient3.write_file method for related issue verification
  • added polars DataFrame serializer tests (skipped if polars is not installed)

No changes in public API.

Checklist

  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional

@codecov
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 70.14925% with 20 lines in your changes missing coverage. Please review.

Project coverage is 52.84%. Comparing base (ede1956) to head (6b576df).

Files Patch % Lines
...client/client/write/polars_dataframe_serializer.py 70.96% 18 Missing ⚠️
influxdb_client_3/write_client/client/_base.py 50.00% 1 Missing ⚠️
influxdb_client_3/write_client/client/write_api.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   49.75%   52.84%   +3.09%     
==========================================
  Files          32       33       +1     
  Lines        2034     2036       +2     
==========================================
+ Hits         1012     1076      +64     
+ Misses       1022      960      -62     

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

@alespour alespour marked this pull request as ready for review June 19, 2024 13:24
@alespour alespour requested review from bednar and karel-rehor and removed request for bednar June 20, 2024 08:14
Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@bednar bednar added this to the 0.7.0 milestone Jun 26, 2024
@bednar bednar merged commit b4c8772 into main Jun 26, 2024
@bednar bednar deleted the fix/polars-optional-import branch June 26, 2024 08:46
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.

`write_file(file='<JSON_FILE>') fails if Polars isn't installed

2 participants