influxdb3-python
influxdb3-python copied to clipboard
feat: support env
Closes Issue
Proposed Changes
- Support creates InfluxDB client with environment variables with the same name as the Go client
Checklist
- [x] CHANGELOG.md updated
- [x] Rebased/mergeable
- [x] A test has been added if appropriate
- [x] Tests pass
- [x] Commit messages are conventional
- [x] Sign CLA (if not already signed)
Codecov Report
Attention: Patch coverage is 96.66667% with 4 lines in your changes missing coverage. Please review.
Project coverage is 63.84%. Comparing base (
93129b0) to head (ec8813c). Report is 6 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| influxdb_client_3/write_client/client/write_api.py | 76.92% | 3 Missing :warning: |
| influxdb_client_3/__init__.py | 98.85% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #127 +/- ##
==========================================
+ Coverage 61.92% 63.84% +1.92%
==========================================
Files 33 33
Lines 2135 2246 +111
==========================================
+ Hits 1322 1434 +112
+ Misses 813 812 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
I think config from environment variables was already supported (see method from_env_properties). What you should support is:
- different set of environment variable names (same as in go -- https://github.com/InfluxCommunity/influxdb3-go/blob/main/influxdb3/client.go#L258-L267)
- plus also keep it backward compatible, so it should work with both the old names and the new names
I think config from environment variables was already supported (see method
from_env_properties). What you should support is:
- different set of environment variable names (same as in go -- https://github.com/InfluxCommunity/influxdb3-go/blob/main/influxdb3/client.go#L258-L267)
- plus also keep it backward compatible, so it should work with both the old names and the new names
Hi Jan I don't get it from_env_properties supports names with v2 in its string My new function supports names like in golang "INFLUX_HOST" "INFLUX_TOKEN" "INFLUX_DATABASE" "INFLUX_ORG"
Hi @jansimonb I pushed the latest code. Please take a look when you have time I converted to draft because I'm not very confident with the fix 🙈 I have not added comments for new functions...
In
from_env_properties(what we want to deprecate) there are 13 environment variables supported. In the newfrom_envwe support 7 env variables. Does that mean that we are loosing some functionality? E.g. is it still possible to use the newfrom_envmethod but also configureconnection_pool_maxsize?
Hi @jansimonb I have increased the number of parameters we support Please check again