Skip to content

Commit d1b1883

Browse files
committed
write accepts a single point or a list.
write_points calls write with data['points'], so write has to verify.
1 parent 3a08029 commit d1b1883

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

influxdb/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def request(self, url, method='GET', params=None, data=None,
242242
else:
243243
raise InfluxDBClientError(response.content, response.status_code)
244244

245-
def write(self, point, params={}, expected_response_code=204):
245+
def write(self, data, params={}, expected_response_code=204):
246246
"""Write data to InfluxDB.
247247
248248
:param data: the data to be written
@@ -256,7 +256,7 @@ def write(self, point, params={}, expected_response_code=204):
256256
:rtype: bool
257257
"""
258258

259-
data = {"points": [point] }
259+
data['points'] = data.get('points', [data]) # Accept a single point or a list
260260

261261
if not 'db' in params:
262262
params['db'] = self._database

0 commit comments

Comments
 (0)