|
2 | 2 | """
|
3 | 3 | Python client for InfluxDB
|
4 | 4 | """
|
5 |
| -from collections import OrderedDict |
| 5 | + |
6 | 6 | from functools import wraps
|
7 | 7 | import json
|
8 | 8 | import socket
|
@@ -180,27 +180,6 @@ def from_DSN(dsn, **kwargs):
|
180 | 180 |
|
181 | 181 | return InfluxDBClient(**init_args)
|
182 | 182 |
|
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 |
| - |
204 | 183 | def switch_database(self, database):
|
205 | 184 | """
|
206 | 185 | switch_database()
|
@@ -309,10 +288,7 @@ def query(self,
|
309 | 288 | expected_response_code=expected_response_code
|
310 | 289 | )
|
311 | 290 |
|
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() |
316 | 292 |
|
317 | 293 | return ResultSet(data)
|
318 | 294 |
|
|
0 commit comments