You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by da...@apache.org on 2026/06/02 15:25:39 UTC

(airflow) branch main updated: Fix MSSQL connection schema field metadata (#66756)

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

dabla 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 4c4df6fd8c3 Fix MSSQL connection schema field metadata (#66756)
4c4df6fd8c3 is described below

commit 4c4df6fd8c36106d132b82983dbc2dffa706993f
Author: Shao Yu-Lung (Allen) <be...@gmail.com>
AuthorDate: Tue Jun 2 23:25:30 2026 +0800

    Fix MSSQL connection schema field metadata (#66756)
    
    * fix: Added new UI field behavior settings and added new connection examples in testing.
    
    * fix: update version to 4.6.0 and add UI field behavior for database schema
    
    ---------
    
    Co-authored-by: Shao Yu-Lung (Allen) <mi...@cendai.com.tw>
---
 providers/microsoft/mssql/provider.yaml                        |  3 +++
 .../src/airflow/providers/microsoft/mssql/get_provider_info.py |  1 +
 .../mssql/tests/unit/microsoft/mssql/hooks/test_mssql.py       | 10 ++++++++++
 3 files changed, 14 insertions(+)

diff --git a/providers/microsoft/mssql/provider.yaml b/providers/microsoft/mssql/provider.yaml
index c2570ed2988..1466dd7587c 100644
--- a/providers/microsoft/mssql/provider.yaml
+++ b/providers/microsoft/mssql/provider.yaml
@@ -108,3 +108,6 @@ connection-types:
   - hook-class-name: airflow.providers.microsoft.mssql.hooks.mssql.MsSqlHook
     hook-name: "Microsoft SQL Server"
     connection-type: mssql
+    ui-field-behaviour:
+      relabeling:
+        schema: Database
diff --git a/providers/microsoft/mssql/src/airflow/providers/microsoft/mssql/get_provider_info.py b/providers/microsoft/mssql/src/airflow/providers/microsoft/mssql/get_provider_info.py
index bfdb0af905d..e9fd2df15e4 100644
--- a/providers/microsoft/mssql/src/airflow/providers/microsoft/mssql/get_provider_info.py
+++ b/providers/microsoft/mssql/src/airflow/providers/microsoft/mssql/get_provider_info.py
@@ -68,6 +68,7 @@ def get_provider_info():
                 "hook-class-name": "airflow.providers.microsoft.mssql.hooks.mssql.MsSqlHook",
                 "hook-name": "Microsoft SQL Server",
                 "connection-type": "mssql",
+                "ui-field-behaviour": {"relabeling": {"schema": "Database"}},
             }
         ],
     }
diff --git a/providers/microsoft/mssql/tests/unit/microsoft/mssql/hooks/test_mssql.py b/providers/microsoft/mssql/tests/unit/microsoft/mssql/hooks/test_mssql.py
index e547b54d224..991e65551de 100644
--- a/providers/microsoft/mssql/tests/unit/microsoft/mssql/hooks/test_mssql.py
+++ b/providers/microsoft/mssql/tests/unit/microsoft/mssql/hooks/test_mssql.py
@@ -112,6 +112,15 @@ def mssql_connections():
             port=8081,
             extra={"SQlalchemy_Scheme": "mssql+testdriver", "myparam": "5@-//*"},
         ),
+        "alt_3": Connection(
+            conn_type="mssql",
+            host="ip",
+            schema="testdb",
+            login="username",
+            password="password",
+            port=8081,
+            extra={"SQlalchemy_Scheme": "mssql+testdriver", "myparam": "5@-//*"},
+        ),
     }
 
 
@@ -120,6 +129,7 @@ URI_TEST_CASES = [
     ("alt", "mssql+pymssql://username:password@ip:8081"),
     ("alt_1", "mssql+testdriver://username:password@ip:8081/"),
     ("alt_2", "mssql+testdriver://username:password@ip:8081/?myparam=5%40-%2F%2F%2A"),
+    ("alt_3", "mssql+testdriver://username:password@ip:8081/testdb?myparam=5%40-%2F%2F%2A"),
 ]