File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,8 @@ def query(self,
308
308
expected_response_code = 200 ,
309
309
database = None ,
310
310
raise_errors = True ,
311
- chunked = False ):
311
+ chunked = False ,
312
+ chunk_size = 0 ):
312
313
"""Send a query to InfluxDB.
313
314
314
315
:param query: the actual query string
@@ -333,6 +334,9 @@ def query(self,
333
334
is returned as opposed to a list.
334
335
:type chunked: bool
335
336
337
+ :param chunk_size: Size of each chunk to tell InfluxDB to use.
338
+ :type chunk_size: int
339
+
336
340
:returns: the queried data
337
341
:rtype: :class:`~.ResultSet`
338
342
"""
@@ -355,6 +359,8 @@ def query(self,
355
359
356
360
if chunked or 'chunked' in params :
357
361
params ['chunked' ] = 'true'
362
+ if chunk_size > 0 :
363
+ params ['chunk_size' ] = chunk_size
358
364
return self ._read_chunked_response (response )
359
365
360
366
data = response .json ()
Original file line number Diff line number Diff line change @@ -813,7 +813,7 @@ def test_chunked_response(self):
813
813
text = example_response
814
814
)
815
815
response = list (self .cli .query ('show series limit 4 offset 0' ,
816
- chunked = True ))
816
+ chunked = True , chunk_size = 4 ))
817
817
self .assertTrue (len (response ) == 4 )
818
818
self .assertEqual (response [0 ].raw , ResultSet (
819
819
{"statement_id" : 0 ,
You can’t perform that action at this time.
0 commit comments