From e28b297b0b2c7c4d309b21ee8943724a79a764c1 Mon Sep 17 00:00:00 2001 From: Wojciech Kocjan Date: Thu, 27 Feb 2020 17:45:59 +0100 Subject: [PATCH] fix: handle case where multiple results include multiple tables --- influxdb_client/client/flux_csv_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/influxdb_client/client/flux_csv_parser.py b/influxdb_client/client/flux_csv_parser.py index 924121ad..4b706d49 100644 --- a/influxdb_client/client/flux_csv_parser.py +++ b/influxdb_client/client/flux_csv_parser.py @@ -52,6 +52,7 @@ def _parse_flux_response(self): start_new_table = False table = None parsing_state_error = False + table_base_index = 0 for csv in self._reader: # debug @@ -80,6 +81,7 @@ def _parse_flux_response(self): yield self._prepare_data_frame() start_new_table = True + table_base_index = table_index table = FluxTable() self._insert_table(table, table_index) table_index = table_index + 1 @@ -111,7 +113,7 @@ def _parse_flux_response(self): continue # to int converions todo - current_index = int(csv[2]) + current_index = int(csv[2]) + table_base_index if current_index > (table_index - 1): # create new table with previous column headers settings