Skip to content

Commit d9343a1

Browse files
committed
fixed error in existing documentation for chunked mode. (it always combines the results in ONE ResultSet, instead of many) Added documentation for stream-mode. Fixed coding style issues
1 parent 15473eb commit d9343a1

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

influxdb/client.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ def _read_chunked_response(response, raise_errors=True):
326326
if isinstance(result[_key], list):
327327
result_set.setdefault(
328328
_key, []).extend(result[_key])
329-
330-
return(ResultSet(result_set, raise_errors=raise_errors))
329+
return ResultSet(result_set, raise_errors=raise_errors)
331330

332331
@staticmethod
333332
def _read_chunked_response_generator(response, raise_errors=True):
@@ -380,13 +379,19 @@ def query(self,
380379
:type raise_errors: bool
381380
382381
:param chunked: Enable to use chunked responses from InfluxDB.
383-
With ``chunked`` enabled, one ResultSet is returned per chunk
384-
containing all results within that chunk
382+
Normally all chunks are automaticly combined into one huge
383+
ResultSet, unless you use ``stream``.
385384
:type chunked: bool
386385
387386
:param chunk_size: Size of each chunk to tell InfluxDB to use.
388387
:type chunk_size: int
389388
389+
:param stream: Will stream the data and return a generator that
390+
generates one ResultSet per chunk containing.
391+
This allows for huge datasets with virtually no limit.
392+
393+
:type stream: bool
394+
390395
:returns: the queried data
391396
:rtype: :class:`~.ResultSet`
392397
"""
@@ -415,10 +420,11 @@ def query(self,
415420

416421
if chunked:
417422
if stream:
418-
return self._read_chunked_response_generator(response,raise_errors)
423+
return self._read_chunked_response_generator(
424+
response, raise_errors
425+
)
419426
else:
420-
return self._read_chunked_response(response,raise_errors)
421-
427+
return self._read_chunked_response(response, raise_errors)
422428

423429
data = response.json()
424430

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy