From 9b4cf12b038f5e6b7c4284c994749bf3db9b07e7 Mon Sep 17 00:00:00 2001 From: Jacob Marble Date: Wed, 7 Aug 2024 11:36:26 -0700 Subject: [PATCH] fix(write-api): accept 201 response to write InfluxDB v3 will soon return 201 or 204, in cases where InfluxDB v1 and v2 only return 204. --- CHANGELOG.md | 1 + influxdb_client/client/write_api_async.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f9df7e5..05c37a17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Bug Fixes 1. [#652](https://github.com/influxdata/influxdb-client-python/pull/652): Refactor to `timezone` specific `datetime` helpers to avoid use deprecated functions +1. [#663](https://github.com/influxdata/influxdb-client-python/pull/663): Accept HTTP 201 response to write request ## 1.44.0 [2024-06-24] diff --git a/influxdb_client/client/write_api_async.py b/influxdb_client/client/write_api_async.py index 2f32802f..e9e2018b 100644 --- a/influxdb_client/client/write_api_async.py +++ b/influxdb_client/client/write_api_async.py @@ -122,4 +122,4 @@ async def write(self, bucket: str, org: str = None, precision=write_precision, async_req=False, _return_http_data_only=False, content_type="text/plain; charset=utf-8") - return response[1] == 204 + return response[1] in (201, 204)