influxdb-client-python icon indicating copy to clipboard operation
influxdb-client-python copied to clipboard

Implement flush in write_api

Open minsungoh opened this issue 1 year ago • 4 comments

Proposed Changes

write_api is send data when it close or delete on batching mode. but i want to reuse same object. so i implement flush function as simply call on_complete

Checklist

  • [x] CHANGELOG.md updated
  • [x] Rebased/mergeable
  • [x] A test has been added if appropriate
  • [x] pytest tests completes successfully
  • [x] Commit messages are conventional
  • [x] Sign CLA (if not already signed)

minsungoh avatar Oct 19 '24 09:10 minsungoh

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.52%. Comparing base (012c50a) to head (b322815).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #678      +/-   ##
==========================================
+ Coverage   90.49%   90.52%   +0.03%     
==========================================
  Files          40       40              
  Lines        3534     3535       +1     
==========================================
+ Hits         3198     3200       +2     
+ Misses        336      335       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 19 '24 09:10 codecov-commenter

Sorry for late reply. i have problem in pytest. is there a auto config for test or should i input my own config? then what file should i change? there are config.ini, config.json, config.toml in tests/.

minsungoh avatar Oct 24 '24 08:10 minsungoh

If you are using Linux or MacOS, you should be able to run tests following this guide - https://github.com/influxdata/influxdb-client-python?tab=readme-ov-file#local-tests

bednar avatar Oct 24 '24 08:10 bednar

There's only mocking tests in tests/test_WriteApiBatching.py, so i made a class extends BaseTest for testing flush works. however, is there a better way to verify that record's saved on influxdb instead of sleep?

minsungoh avatar Oct 25 '24 12:10 minsungoh