From b398915e13eb67903ade3386ff02590470010e71 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Thu, 18 Jun 2026 20:56:28 +0700 Subject: [PATCH 1/2] test: adjust partial writes test to v3.10 behaviour --- tests/test_influxdb_client_3_integration.py | 90 ++++++++++++--------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/tests/test_influxdb_client_3_integration.py b/tests/test_influxdb_client_3_integration.py index 8d3dffa..845fd8b 100644 --- a/tests/test_influxdb_client_3_integration.py +++ b/tests/test_influxdb_client_3_integration.py @@ -1,3 +1,4 @@ +import json import logging import os import random @@ -13,6 +14,7 @@ from influxdb_client_3 import InfluxDBClient3, write_client_options, WriteOptions, \ WriteType, InfluxDB3ClientQueryError from influxdb_client_3.exceptions import InfluxDBError, InfluxDBPartialWriteError +from influxdb_client_3.write_client.rest import ApiException from tests.util import asyncio_run, lp_to_py_object @@ -133,28 +135,37 @@ def test_v3_error(self): for accept_partial in [True, False]: with self.subTest(accept_partial=accept_partial): with InfluxDBClient3( - host=self.host, - database=self.database, - token=self.token, - write_client_options=write_client_options(write_options=WriteOptions( - write_type=WriteType.synchronous, - use_v2_api=False, - accept_partial=accept_partial - )) + host=self.host, + database=self.database, + token=self.token, + write_client_options=write_client_options(write_options=WriteOptions( + write_type=WriteType.synchronous, + use_v2_api=False, + accept_partial=accept_partial + )) ) as client: - with self.assertRaises(InfluxDBPartialWriteError) as err: - client.write(lp) - - msg = err.exception.message - self.assertTrue( - "partial write of line protocol occurred" in msg or "parsing failed for write_lp endpoint" in msg - ) - self.assertIn(( - "invalid column type for column 'temp', expected iox::column_type::field::float, " - "got iox::column_type::field::string" - ), msg) - self.assertIn("line 2", msg) - self.assertIn("home,room=Sunroom", msg) + if accept_partial: + with self.assertRaises(InfluxDBPartialWriteError) as err: + client.write(lp) + + self.assertEqual(1, len(err.exception.line_errors)) + line_error = err.exception.line_errors[0] + self.assertEqual(2, line_error.line_number) + self.assertIn("invalid column type for column 'temp'", line_error.error_message) + self.assertIn("home,room=Sunroom", line_error.original_line) + else: + with self.assertRaises(ApiException) as err: + client.write(lp) + + self.assertEqual(400, err.exception.status) + self.assertEqual("line protocol parsing error", err.exception.message) + body = json.loads(err.exception.body) + self.assertEqual("line protocol parsing error", body["error"]) + self.assertEqual(2, body["data"]["line_number"]) + self.assertIn( + "invalid column type for column 'temp'", + body["data"]["error_message"], + ) def test_v2_error(self): lp = "\n".join([ @@ -162,23 +173,26 @@ def test_v2_error(self): "home,room=Sunroom temp=\"hi\" 1735549200", ]) - with InfluxDBClient3( - host=self.host, - database=self.database, - token=self.token, - write_client_options=write_client_options(write_options=WriteOptions( - write_type=WriteType.synchronous, - use_v2_api=True, - accept_partial=False - )) - ) as client: - with self.assertRaises(InfluxDBError) as err: - client.write(lp) - - self.assertNotIsInstance(err.exception, InfluxDBPartialWriteError) - self.assertIsNotNone(err.exception.response) - self.assertEqual(400, err.exception.response.status) - self.assertTrue(err.exception.message) + for accept_partial in [True, False]: + with self.subTest(accept_partial=accept_partial): + with InfluxDBClient3( + host=self.host, + database=self.database, + token=self.token, + write_client_options=write_client_options(write_options=WriteOptions( + write_type=WriteType.synchronous, + use_v2_api=True, + accept_partial=accept_partial + )) + ) as client: + with self.assertRaises(ApiException) as err: + client.write(lp) + + self.assertEqual(400, err.exception.status) + self.assertNotIsInstance(err.exception, InfluxDBPartialWriteError) + body = json.loads(err.exception.body) + self.assertEqual("invalid", body["code"]) + self.assertIn("write buffer error", body["message"]) def test_auth_error_token(self): self.client = InfluxDBClient3(host=self.host, database=self.database, token='fake token') From 6b35fccbd72cb943bac71d8304d8ce0fe0821a1c Mon Sep 17 00:00:00 2001 From: NguyenHoangSon96 Date: Fri, 19 Jun 2026 09:59:54 +0700 Subject: [PATCH 2/2] ci: fix gpg download scripts --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1a7b58..5082956 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,7 +71,7 @@ commands: curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig - curl -s https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -fsSL https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import gpgv codecov.SHA256SUM.sig codecov.SHA256SUM shasum -a 256 -c codecov.SHA256SUM chmod +x ./codecov @@ -81,13 +81,14 @@ commands: - run: name: Collecting coverage reports command: | - curl -k https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import curl -Os https://uploader.codecov.io/v0.8.0/aarch64/codecov curl -Os https://uploader.codecov.io/v0.8.0/aarch64/codecov.SHA256SUM curl -Os https://uploader.codecov.io/v0.8.0/aarch64/codecov.SHA256SUM.sig + curl -fsSL https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import gpgv codecov.SHA256SUM.sig codecov.SHA256SUM shasum -a 256 -c codecov.SHA256SUM - sudo chmod +x codecov + sudo chmod +x codecov + ./codecov jobs: tests-python: