influxdata / influxdb-python

Python client for InfluxDB
MIT License
1.7k stars 522 forks source link

.close() does not seem to close the client #857

Open newskooler opened 4 years ago

newskooler commented 4 years ago

I am having the following issue/question: When I open a client via python, do something with it and then close it, I expect not to be able to use the client again (to ping, query, etc.), but this is possible for some reason.

For example, the following code:

from influxdb import InfluxDBClient

idb_client = InfluxDBClient(host, port, username, password)
print(idb_client._username)
print(idb_client.close())
print(idb_client.ping())

Yields this:

my_idb_user
None
1.8.0
my_idb_user

Why is that? If that is expected behaviour, then how do I close an established connection via python?