8000 Merge pull request #168 from savoirfairelinux/clean_keep_json_respons… · krishnazure/influxdb-python@99b7b9e · GitHub
[go: up one dir, main page]

Skip to content

Commit 99b7b9e

Browse files
committed
Merge pull request influxdata#168 from savoirfairelinux/clean_keep_json_response_order
clean: not anymore used/necessary.
2 parents 4843bce + 9d0b4f0 commit 99b7b9e

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

influxdb/client.py

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33
Python client for InfluxDB
44
"""
5-
from collections import OrderedDict
5+
66
from functools import wraps
77
import json
88
import socket
@@ -180,27 +180,6 @@ def from_DSN(dsn, **kwargs):
180180

181181
return InfluxDBClient(**init_args)
182182

183-
#
184-
# By default we keep the "order" of the json responses:
185-
# more clearly: any dict contained in the json response will have
186-
# its key-value items order kept as in the raw answer, thanks to
187-
# `collections.OrderedDict`.
188-
# if one doesn't care in that, then it can simply change its client
189-
# instance 'keep_json_response_order' attribute value (to a falsy one).
190-
# This will then eventually help for performance considerations.
191-
_keep_json_response_order = False
192-
# NB: For "group by" query type :
193-
# This setting is actually necessary in order to have a consistent and
194-
# reproducible rsp format if you "group by" on more than 1 tag.
195-
196-
@property
197-
def keep_json_response_order(self):
198-
return self._keep_json_response_order
199-
200-
@keep_json_response_order.setter
201-
def keep_json_response_order(self, new_value):
202-
self._keep_json_response_order = new_value
203-
204183
def switch_database(self, database):
205184
"""
206185
switch_database()
@@ -309,10 +288,7 @@ def query(self,
309288
expected_response_code=expected_response_code
310289
)
311290

312-
json_kw = {}
313-
if self.keep_json_response_order:
314-
json_kw.update(object_pairs_hook=OrderedDict)
315-
data = response.json(**json_kw)
291+
data = response.json()
316292

317293
return ResultSet(data)
318294

0 commit comments

Comments
 (0)
0