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,
308308 expected_response_code = 200 ,
309309 database = None ,
310310 raise_errors = True ,
311- chunked = False ):
311+ chunked = False ,
312+ chunk_size = 0 ):
312313 """Send a query to InfluxDB.
313314
314315 :param query: the actual query string
@@ -333,6 +334,9 @@ def query(self,
333334 is returned as opposed to a list.
334335 :type chunked: bool
335336
337+ :param chunk_size: Size of each chunk to tell InfluxDB to use.
338+ :type chunk_size: int
339+
336340 :returns: the queried data
337341 :rtype: :class:`~.ResultSet`
338342 """
@@ -355,6 +359,8 @@ def query(self,
355359
356360 if chunked or 'chunked' in params :
357361 params ['chunked' ] = 'true'
362+ if chunk_size > 0 :
363+ params ['chunk_size' ] = chunk_size
358364 return self ._read_chunked_response (response )
359365
360366 data = response .json ()
Original file line number Diff line number Diff line change @@ -813,7 +813,7 @@ def test_chunked_response(self):
813813 text = example_response
814814 )
815815 response = list (self .cli .query ('show series limit 4 offset 0' ,
816- chunked = True ))
816+ chunked = True , chunk_size = 4 ))
817817 self .assertTrue (len (response ) == 4 )
818818 self .assertEqual (response [0 ].raw , ResultSet (
819819 {"statement_id" : 0 ,
You can’t perform that action at this time.
0 commit comments