This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 5c900cc018a Fix ClickHouse test_connection unit test failing with
newer clickhouse-connect (#70114)
5c900cc018a is described below
commit 5c900cc018ae9460902ed17de0d0f876fcc8f614
Author: Henry Chen <[email protected]>
AuthorDate: Mon Jul 20 16:40:31 2026 +0800
Fix ClickHouse test_connection unit test failing with newer
clickhouse-connect (#70114)
* Fix ClickHouse test_connection unit test failing with newer
clickhouse-connect
The assertion pinned the exact call signature that clickhouse_connect's
DB-API cursor uses internally, which changed in 1.4.x. Only the SQL sent
is relevant to what the test verifies, so the provider keeps working
across the whole supported clickhouse-connect range.
* Assert bound parameters too, not just the statement
Reviewer feedback: the statement and its parameters are Airflow's own
contract, so both belong in the assertion; only what the driver appends
on top of them is out of scope.
---
.../tests/unit/clickhousedb/hooks/test_clickhouse.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git
a/providers/clickhousedb/tests/unit/clickhousedb/hooks/test_clickhouse.py
b/providers/clickhousedb/tests/unit/clickhousedb/hooks/test_clickhouse.py
index d8e087e65ad..00f1911e425 100644
--- a/providers/clickhousedb/tests/unit/clickhousedb/hooks/test_clickhouse.py
+++ b/providers/clickhousedb/tests/unit/clickhousedb/hooks/test_clickhouse.py
@@ -1147,8 +1147,13 @@ class TestClickHouseHookTestConnection:
hook = ClickHouseHook(clickhouse_conn_id="clickhouse_test")
hook.test_connection()
- # clickhouse_connect.dbapi.Cursor passes parameters positionally; None
when not provided.
- mock_client.query.assert_called_once_with("SELECT 1", None)
+ # Assert on the statement and the bound parameters only. Anything the
+ # driver appends beyond those (e.g. a settings kwarg) is its own
concern
+ # and varies between releases.
+ mock_client.query.assert_called_once()
+ sql, parameters = mock_client.query.call_args.args[:2]
+ assert sql == "SELECT 1"
+ assert not parameters
# ---------------------------------------------------------------------------