From 976b87484d5c3c629fd1ebace373b0cd5f2cad87 Mon Sep 17 00:00:00 2001 From: Trilok Jain Date: Thu, 20 Jul 2023 14:51:43 +0530 Subject: [PATCH 1/6] Remove Content-Encoding=Identity as the header as it violates the RFC --- influxdb_client/client/write_api.py | 2 +- influxdb_client/client/write_api_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/influxdb_client/client/write_api.py b/influxdb_client/client/write_api.py index bf8da230..61242446 100644 --- a/influxdb_client/client/write_api.py +++ b/influxdb_client/client/write_api.py @@ -507,7 +507,7 @@ def _retry_callback_delegate(exception): def _post_write(self, _async_req, bucket, org, body, precision, **kwargs): return self._write_service.post_write(org=org, bucket=bucket, body=body, precision=precision, - async_req=_async_req, content_encoding="identity", + async_req=_async_req, content_type="text/plain; charset=utf-8", **kwargs) diff --git a/influxdb_client/client/write_api_async.py b/influxdb_client/client/write_api_async.py index e0ba021d..2f32802f 100644 --- a/influxdb_client/client/write_api_async.py +++ b/influxdb_client/client/write_api_async.py @@ -120,6 +120,6 @@ async def write(self, bucket: str, org: str = None, body = b'\n'.join(payloads[write_precision]) response = await self._write_service.post_write_async(org=org, bucket=bucket, body=body, precision=write_precision, async_req=False, - content_encoding="identity", _return_http_data_only=False, + _return_http_data_only=False, content_type="text/plain; charset=utf-8") return response[1] == 204 From ad546ad0aad3e18855fafaec4199c2f91c169be8 Mon Sep 17 00:00:00 2001 From: Trilok Jain Date: Thu, 20 Jul 2023 15:26:46 +0530 Subject: [PATCH 2/6] Test fix --- tests/test_gzip.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_gzip.py b/tests/test_gzip.py index c37d7733..b847d370 100644 --- a/tests/test_gzip.py +++ b/tests/test_gzip.py @@ -60,7 +60,6 @@ def test_gzip_disabled(self): self.assertEqual("identity", _requests[0].headers['Accept-Encoding']) # Write self.assertEqual("/api/v2/write?org=my-org&bucket=my-bucket&precision=ns", _requests[1].path) - self.assertEqual("identity", _requests[1].headers['Content-Encoding']) self.assertEqual("identity", _requests[1].headers['Accept-Encoding']) self.assertEqual("h2o_feet,location=coyote_creek water_level=1 1", _requests[1].parsed_body) # Query From ee0db05b331f63136277138952c2c6cb5fc29b64 Mon Sep 17 00:00:00 2001 From: Trilok Jain Date: Thu, 20 Jul 2023 15:26:46 +0530 Subject: [PATCH 3/6] (fix) Removing the non-standard header Config-Encoding: identity --- tests/test_gzip.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_gzip.py b/tests/test_gzip.py index c37d7733..b847d370 100644 --- a/tests/test_gzip.py +++ b/tests/test_gzip.py @@ -60,7 +60,6 @@ def test_gzip_disabled(self): self.assertEqual("identity", _requests[0].headers['Accept-Encoding']) # Write self.assertEqual("/api/v2/write?org=my-org&bucket=my-bucket&precision=ns", _requests[1].path) - self.assertEqual("identity", _requests[1].headers['Content-Encoding']) self.assertEqual("identity", _requests[1].headers['Accept-Encoding']) self.assertEqual("h2o_feet,location=coyote_creek water_level=1 1", _requests[1].parsed_body) # Query From cc6ec9aa8dcec47e152ec4549afd3a5ea3684524 Mon Sep 17 00:00:00 2001 From: Trilok Jain Date: Thu, 20 Jul 2023 17:55:42 +0530 Subject: [PATCH 4/6] (fix) Removing the non-standard header Config-Encoding: identity --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e007b99..ba12ee49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## 1.37.0 [unreleased] +1. The `Config-Encoding: identity` header will not be set by the `write` calls to the remote endpoints + ### Breaking Changes This release disables using of the HTTP proxy environment variables `HTTP_PROXY` and `HTTPS_PROXY` for the asynchronous HTTP client. From f520af1bb2d837a4aea90ce6a02cf4d6a8184966 Mon Sep 17 00:00:00 2001 From: Trilok Jain Date: Thu, 20 Jul 2023 18:15:28 +0530 Subject: [PATCH 5/6] (fix) Removing the non-standard header Config-Encoding: identity --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba12ee49..1d09d720 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 1.37.0 [unreleased] -1. The `Config-Encoding: identity` header will not be set by the `write` calls to the remote endpoints +1. The `Config-Encoding: identity` header will no longer be set by the `write_api` calls to a remote server ### Breaking Changes From 53b3594b6dfab8673b0442fe984220ce4c3faec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bedn=C3=A1=C5=99?= Date: Fri, 21 Jul 2023 06:37:40 +0200 Subject: [PATCH 6/6] docs: Update CHANGELOG.md --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d09d720..e50896d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,5 @@ ## 1.37.0 [unreleased] -1. The `Config-Encoding: identity` header will no longer be set by the `write_api` calls to a remote server - ### Breaking Changes This release disables using of the HTTP proxy environment variables `HTTP_PROXY` and `HTTPS_PROXY` for the asynchronous HTTP client. @@ -31,6 +29,7 @@ This release introduces a support for new version of InfluxDB API definitions wi ### Bug Fixes 1. [#583](https://github.com/influxdata/influxdb-client-python/pull/583): Async HTTP client doesn't always use `HTTP_PROXY`/`HTTPS_PROXY` environment variables. [async/await] 1. [#584](https://github.com/influxdata/influxdb-client-python/pull/584): Parsing empty query result value as `numpy.NaN` +1. [#595](https://github.com/influxdata/influxdb-client-python/pull/595): The `Config-Encoding: identity` header will no longer be set by the `write_api` calls to a remote server ## 1.36.1 [2023-02-23]