Skip to content

Commit 36888b0

Browse files
committed
chore: remove import of asyncio in non-async API
1 parent d5714cf commit 36888b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

influxdb_client/client/flux_csv_parser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Parsing response from InfluxDB to FluxStructures or DataFrame."""
22

3-
import asyncio
43
import base64
54
import codecs
65
import csv as csv_parser
@@ -147,8 +146,10 @@ async def _parse_flux_response_async(self):
147146
df = self._prepare_data_frame()
148147
if not self._is_profiler_table(metadata.table):
149148
yield df
150-
except (asyncio.exceptions.CancelledError, asyncio.TimeoutError) as ce:
151-
ce.add_note("Stream cancelled during read. Recommended: Check Influxdb client `timeout` setting.")
149+
except BaseException as e:
150+
e_type = type(e).__name__
151+
if "CancelledError" in e_type or "TimeoutError" in e_type:
152+
e.add_note("Stream cancelled during read. Recommended: Check Influxdb client `timeout` setting.")
152153
raise
153154
finally:
154155
self._close()

0 commit comments

Comments
 (0)