sameerpandey17 commented on code in PR #75635:
URL: https://github.com/apache/airflow/pull/75635#discussion_r4533438055


##########
airflow-core/tests/unit/api_fastapi/common/test_parameters.py:
##########
@@ -550,12 +545,108 @@ def run(term: str) -> list[str]:
             ("z", ["z1", "zz"]),
             # Documented trade-off, unchanged: a trailing '_' is stripped, so 
'dag_' means 'dag'.
             ("dag_", ["dagZ1", "dag_9", "dag_99", "dag_abc", "dagz9"]),
+            # Contraction digraph cases (Czech 'ch', Welsh 'ng')
+            ("c", ["cesta", "ch1", "chata"]),
+            ("ch", ["ch1", "chata"]),
+            ("n", ["ng1", "nginx", "nop"]),
+            ("ng", ["ng1", "nginx"]),
         ],
     )
     def test_only_values_with_the_prefix_come_back(self, select_names, term, 
expected):
         assert select_names(term) == expected
 
 
[email protected]_test
[email protected]("postgres")
+class TestPrefixSearchContractionCollationsPostgres:
+    """
+    Verify prefix search under ICU collations with contractions on PostgreSQL.
+
+    Contraction collations reorder multi-character sequences:
+    - Czech (``cs-CZ-x-icu``): digraph ``ch`` sorts after ``h`` (between ``h`` 
and ``i``).
+    - Welsh (``cy-x-icu``): digraph ``ng`` sorts after ``g`` (before ``n``).
+    - Igbo (``ig-x-icu``): digraph ``ch`` sorts before ``c``.
+
+    Under these collations, range bounds (``>=`` or ``<``) miss valid matches:
+    - Upper bound: in Czech, ``chata < 'd'`` is False, so prefix ``c`` misses 
``chata``.
+    - Lower bound: in Welsh, ``'ng1' >= 'n'`` is False, so prefix ``n`` misses 
``ng1``.
+    - Lower bound: in Igbo, ``'ch1' >= 'c'`` is False, so prefix ``c`` misses 
``ch1``.
+
+    The exact ``substr(col, 1, len) = prefix`` check is collation-independent 
and
+    returns exactly the rows matching Python's ``str.startswith``.
+    """
+
+    ROWS = [
+        "chata",
+        "cesta",
+        "ch1",
+        "ng1",
+        "nginx",
+        "nop",
+        "Chata",
+        "Cesta",
+        "NG1",
+        "Nginx",
+        "Nop",
+    ]
+
+    COLLATIONS = ["cs-CZ-x-icu", "cy-x-icu", "ig-x-icu"]
+    PREFIXES = ["c", "ch", "n", "ng"]
+
+    @pytest.mark.parametrize("collation", COLLATIONS)

Review Comment:
   Yes, done. The test is now parametrized over both the collation and the 
prefix (3 collations × 4 prefixes = 12 cases), and each case uses its own table 
name so parallel test workers can't collide. 80 passed, 0 skipped on Postgres 
16.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to