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

amoghdesai 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 f03beb90287 Migrate mongo connection UI metadata to YAML (#62444)
f03beb90287 is described below

commit f03beb9028724bb007003701286ecce9815b0049
Author: Haseeb Malik <[email protected]>
AuthorDate: Fri Feb 27 06:47:33 2026 -0500

    Migrate mongo connection UI metadata to YAML (#62444)
---
 providers/mongo/provider.yaml                      | 25 ++++++++++++++++++++++
 .../airflow/providers/mongo/get_provider_info.py   | 14 +++++++++++-
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/providers/mongo/provider.yaml b/providers/mongo/provider.yaml
index a500db7b376..adb1c5de2d6 100644
--- a/providers/mongo/provider.yaml
+++ b/providers/mongo/provider.yaml
@@ -86,3 +86,28 @@ hooks:
 connection-types:
   - hook-class-name: airflow.providers.mongo.hooks.mongo.MongoHook
     connection-type: mongo
+    conn-fields:
+      srv:
+        label: Srv
+        schema:
+          type:
+            - boolean
+            - 'null'
+      ssl:
+        label: Ssl
+        schema:
+          type:
+            - boolean
+            - 'null'
+      allow_insecure:
+        label: Allow Insecure
+        schema:
+          type:
+            - boolean
+            - 'null'
+    ui-field-behaviour:
+      relabeling:
+        login: Username
+        schema: Default DB
+      placeholders:
+        port: 'Note: port should not be set for SRV connections'
diff --git a/providers/mongo/src/airflow/providers/mongo/get_provider_info.py 
b/providers/mongo/src/airflow/providers/mongo/get_provider_info.py
index c04fdd9315e..2a6eb2befe2 100644
--- a/providers/mongo/src/airflow/providers/mongo/get_provider_info.py
+++ b/providers/mongo/src/airflow/providers/mongo/get_provider_info.py
@@ -39,6 +39,18 @@ def get_provider_info():
         ],
         "hooks": [{"integration-name": "MongoDB", "python-modules": 
["airflow.providers.mongo.hooks.mongo"]}],
         "connection-types": [
-            {"hook-class-name": 
"airflow.providers.mongo.hooks.mongo.MongoHook", "connection-type": "mongo"}
+            {
+                "hook-class-name": 
"airflow.providers.mongo.hooks.mongo.MongoHook",
+                "connection-type": "mongo",
+                "conn-fields": {
+                    "srv": {"label": "Srv", "schema": {"type": ["boolean", 
"null"]}},
+                    "ssl": {"label": "Ssl", "schema": {"type": ["boolean", 
"null"]}},
+                    "allow_insecure": {"label": "Allow Insecure", "schema": 
{"type": ["boolean", "null"]}},
+                },
+                "ui-field-behaviour": {
+                    "relabeling": {"login": "Username", "schema": "Default 
DB"},
+                    "placeholders": {"port": "Note: port should not be set for 
SRV connections"},
+                },
+            }
         ],
     }

Reply via email to