gusutabopb / aioinflux

Asynchronous Python client for InfluxDB
MIT License
159 stars 31 forks source link

Unclosed client session warning #7

Closed gusutabopb closed 6 years ago

gusutabopb commented 6 years ago

When doing exploratory data analysis with Jupyter (using blocking or dataframe mode), the following warning often shows up:

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x112138048>

That happens whenever a new AsyncInfluxDBClient object and assign it to the same name a another AsyncInfluxDBClient was assigned to previously. In other words, when a cell with the following code is executed more than once:

client = AsyncInfluxDBClient(host='my.host.io', mode='dataframe', db='mydb')

Reimplementing __del__ (removed in #4), would likely solve this issue.

Related issue: https://github.com/aio-libs/aiohttp/issues/1175