Skip to content

Commit 2e8c588

Browse files
committed
fix for using from_DSN constructor with dataframe
1 parent f9bd6cc commit 2e8c588

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

influxdb/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ def _port(self):
131131
def _get_port(self):
132132
return self.__port
133133

134-
@staticmethod
135-
def from_DSN(dsn, **kwargs):
134+
@classmethod
135+
def from_DSN(cls, dsn, **kwargs):
136136
"""Return an instance of :class:`~.InfluxDBClient` from the provided
137137
data source name. Supported schemes are "influxdb", "https+influxdb"
138138
and "udp+influxdb". Parameters for the :class:`~.InfluxDBClient`
@@ -169,7 +169,7 @@ def from_DSN(dsn, **kwargs):
169169
init_args['port'] = port
170170
init_args.update(kwargs)
171171

172-
return InfluxDBClient(**init_args)
172+
return cls(**init_args)
173173

174174
def switch_database(self, database):
175175
"""Change the client's database.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy