This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch fix-uuid-suffix-test-exceptions in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 40977f30955dfce7c36758ba0d976eb941d60408 Author: Jarek Potiuk <[email protected]> AuthorDate: Sun Mar 15 22:22:36 2026 +0100 fix: use uuid_suffix in postgres unique constraint test expectations 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', }, ),
