This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 166ee122956 fix: use uuid_suffix in postgres unique constraint test
expectations (#63674)
166ee122956 is described below
commit 166ee1229569bf8bc46909a3a759fffdcd5d4947
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Mar 15 23:18:26 2026 +0100
fix: use uuid_suffix in postgres unique constraint test expectations
(#63674)
The test expected SQL without ::UUID type cast for team_id, but
SQLAlchemy v2 generates %(team_id)s::UUID on Postgres. The uuid_suffix
variable was already defined for this purpose but not used.
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
airflow-core/tests/unit/api_fastapi/common/test_exceptions.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
b/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
index 2ae935ddb04..0ff205dc4cd 100644
--- a/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
+++ b/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
@@ -210,7 +210,7 @@ class TestUniqueConstraintErrorHandler:
status_code=status.HTTP_409_CONFLICT,
detail={
"reason": "Unique constraint violation",
- "statement": "INSERT INTO slot_pool (pool, slots,
description, include_deferred, team_id) VALUES (%(pool)s, %(slots)s,
%(description)s, %(include_deferred)s, %(team_id)s) RETURNING slot_pool.id",
+ "statement": f"INSERT INTO slot_pool (pool, slots,
description, include_deferred, team_id) VALUES (%(pool)s, %(slots)s,
%(description)s, %(include_deferred)s, %(team_id)s{uuid_suffix}) RETURNING
slot_pool.id",
"orig_error": 'duplicate key value violates unique
constraint "slot_pool_pool_uq"\nDETAIL: Key (pool)=(test_pool) already
exists.\n',
},
),
@@ -236,7 +236,7 @@ class TestUniqueConstraintErrorHandler:
status_code=status.HTTP_409_CONFLICT,
detail={
"reason": "Unique constraint violation",
- "statement": "INSERT INTO variable (key, val,
description, is_encrypted, team_id) VALUES (%(key)s, %(val)s, %(description)s,
%(is_encrypted)s, %(team_id)s) RETURNING variable.id",
+ "statement": f"INSERT INTO variable (key, val,
description, is_encrypted, team_id) VALUES (%(key)s, %(val)s, %(description)s,
%(is_encrypted)s, %(team_id)s{uuid_suffix}) RETURNING variable.id",
"orig_error": 'duplicate key value violates unique
constraint "variable_key_uq"\nDETAIL: Key (key)=(test_key) already exists.\n',
},
),