You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2026/03/15 21:23:00 UTC

(airflow) branch fix-uuid-suffix-test-exceptions created (now 40977f30955)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a change to branch fix-uuid-suffix-test-exceptions
in repository https://gitbox.apache.org/repos/asf/airflow.git


      at 40977f30955 fix: use uuid_suffix in postgres unique constraint test expectations

This branch includes the following new commits:

     new 40977f30955 fix: use uuid_suffix in postgres unique constraint test expectations

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(airflow) 01/01: fix: use uuid_suffix in postgres unique constraint test expectations

Posted by po...@apache.org.
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 <ja...@potiuk.com>
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) <no...@anthropic.com>
---
 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',
                         },
                     ),