Skip to content

Commit 3ebf1ac

Browse files
feat: support gzip_threshold
1 parent db0c51d commit 3ebf1ac

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

influxdb_client_3/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,23 @@ def __init__(
226226

227227
@classmethod
228228
def from_env(cls, **kwargs: Any) -> 'InfluxDBClient3':
229-
229+
"""
230+
Creates an instance of the ``InfluxDBClient3`` class using environment
231+
variables for configuration. This method simplifies client creation by
232+
automatically reading required information from the system environment.
233+
234+
It verifies the presence of required environment variables such as host,
235+
token, and database. If any of these variables are missing or empty,
236+
a ``ValueError`` will be raised. Optional parameters such as precision and
237+
authentication scheme will also be extracted from the environment when
238+
present, allowing further customization of the client.
239+
240+
:param kwargs: Additional parameters that are passed to the client constructor.
241+
:type kwargs: Any
242+
:raises ValueError: If any required environment variables are missing or empty.
243+
:return: An initialized client object of type ``InfluxDBClient3``.
244+
:rtype: InfluxDBClient3
245+
"""
230246
required_vars = {
231247
INFLUX_HOST: os.getenv(INFLUX_HOST),
232248
INFLUX_TOKEN: os.getenv(INFLUX_TOKEN),

0 commit comments

Comments
 (0)