influxdata / influxdb-client-python

InfluxDB 2.0 python client
https://influxdb-client.readthedocs.io/en/stable/
MIT License
724 stars 187 forks source link

Specify header name for from_config_file() function #585

Closed aaalloc closed 1 year ago

aaalloc commented 1 year ago

Proposal: To be able to specify which header chose from a config file instead having by default "influx2"

Current behavior: When loading a config file via from_config_file() it is impossible to specify which header we want to load and load by default influx2 header

Desired behavior: from_config_file(section="influx2", ...)

Use case: To be able to load / switch config more easily

bednar commented 1 year ago

Hi @Siirko,

thanks for your suggestion 👍

Is this something you would be willing to help with? All PR is welcome and we will be happy to review your submission.

Regards

aaalloc commented 1 year ago

Hi @Siirko,

thanks for your suggestion 👍

Is this something you would be willing to help with? All PR is welcome and we will be happy to review your submission.

Regards

If I have times yes, but this is can be easily implemented on this file https://github.com/influxdata/influxdb-client-python/blob/77cac49181a6b7236a8a6a16d0e5939973006b52/influxdb_client/client/_base.py#L114 where 'influx2' is a argument of _from_config_file() function

aaalloc commented 1 year ago

@bednar Functionality added with test, tell me if I need to add more test ....