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

potiuk 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 75386ca25db Migrate ydb connection UI metadata to YAML (#63412)
75386ca25db is described below

commit 75386ca25dbd63bcaeff743eb6eca81a5b84c23b
Author: Henry Chen <[email protected]>
AuthorDate: Thu Mar 12 21:42:34 2026 +0800

    Migrate ydb connection UI metadata to YAML (#63412)
---
 providers/ydb/provider.yaml                        | 56 ++++++++++++++++++++++
 .../src/airflow/providers/ydb/get_provider_info.py | 43 ++++++++++++++++-
 2 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/providers/ydb/provider.yaml b/providers/ydb/provider.yaml
index 2be8e256962..72a3bd4b510 100644
--- a/providers/ydb/provider.yaml
+++ b/providers/ydb/provider.yaml
@@ -68,3 +68,59 @@ hooks:
 connection-types:
   - hook-class-name: airflow.providers.ydb.hooks.ydb.YDBHook
     connection-type: ydb
+    ui-field-behaviour:
+      hidden-fields:
+        - schema
+        - extra
+      placeholders:
+        host: eg. grpcs://my_host or ydb.serverless.yandexcloud.net or 
lb.etn9txxxx.ydb.mdb.yandexcloud.net
+        login: root
+        password: my_password
+        database: e.g. /local or 
/ru-central1/b1gtl2kg13him37quoo6/etndqstq7ne4v68n6c9b
+        service_account_json: 'e.g. {"id": "...", "service_account_id": "...", 
"private_key": "..."}'
+        token: t1.9....AAQ
+    conn-fields:
+      database:
+        label: Database name
+        schema:
+          type:
+            - string
+            - 'null'
+        description: Required. YDB database name
+      service_account_json:
+        label: Service account auth JSON
+        schema:
+          type:
+            - string
+            - 'null'
+          format: password
+        description: >-
+          Service account auth JSON. Looks like {"id": "...", 
"service_account_id": "...",
+          "private_key": "..."}.
+          Will be used instead of IAM token and SA JSON file path field if
+          specified.
+      service_account_json_path:
+        label: Service account auth JSON file path
+        schema:
+          type:
+            - string
+            - 'null'
+        description: >-
+          Service account auth JSON file path. File content looks like
+          {"id": "...", "service_account_id": "...", "private_key": "..."}.
+      token:
+        label: IAM token
+        schema:
+          type:
+            - string
+            - 'null'
+          format: password
+        description: User account IAM token.
+      use_vm_metadata:
+        label: Use VM metadata
+        schema:
+          type:
+            - boolean
+            - 'null'
+          default: false
+        description: Optional. Whether to use VM metadata to retrieve IAM token
diff --git a/providers/ydb/src/airflow/providers/ydb/get_provider_info.py 
b/providers/ydb/src/airflow/providers/ydb/get_provider_info.py
index 8dd644fff4c..056b0cc58eb 100644
--- a/providers/ydb/src/airflow/providers/ydb/get_provider_info.py
+++ b/providers/ydb/src/airflow/providers/ydb/get_provider_info.py
@@ -38,6 +38,47 @@ def get_provider_info():
         "operators": [{"integration-name": "YDB", "python-modules": 
["airflow.providers.ydb.operators.ydb"]}],
         "hooks": [{"integration-name": "YDB", "python-modules": 
["airflow.providers.ydb.hooks.ydb"]}],
         "connection-types": [
-            {"hook-class-name": "airflow.providers.ydb.hooks.ydb.YDBHook", 
"connection-type": "ydb"}
+            {
+                "hook-class-name": "airflow.providers.ydb.hooks.ydb.YDBHook",
+                "connection-type": "ydb",
+                "ui-field-behaviour": {
+                    "hidden-fields": ["schema", "extra"],
+                    "placeholders": {
+                        "host": "eg. grpcs://my_host or 
ydb.serverless.yandexcloud.net or lb.etn9txxxx.ydb.mdb.yandexcloud.net",
+                        "login": "root",
+                        "password": "my_password",
+                        "database": "e.g. /local or 
/ru-central1/b1gtl2kg13him37quoo6/etndqstq7ne4v68n6c9b",
+                        "service_account_json": 'e.g. {"id": "...", 
"service_account_id": "...", "private_key": "..."}',
+                        "token": "t1.9....AAQ",
+                    },
+                },
+                "conn-fields": {
+                    "database": {
+                        "label": "Database name",
+                        "schema": {"type": ["string", "null"]},
+                        "description": "Required. YDB database name",
+                    },
+                    "service_account_json": {
+                        "label": "Service account auth JSON",
+                        "schema": {"type": ["string", "null"], "format": 
"password"},
+                        "description": 'Service account auth JSON. Looks like 
{"id": "...", "service_account_id": "...", "private_key": "..."}. Will be used 
instead of IAM token and SA JSON file path field if specified.',
+                    },
+                    "service_account_json_path": {
+                        "label": "Service account auth JSON file path",
+                        "schema": {"type": ["string", "null"]},
+                        "description": 'Service account auth JSON file path. 
File content looks like {"id": "...", "service_account_id": "...", 
"private_key": "..."}.',
+                    },
+                    "token": {
+                        "label": "IAM token",
+                        "schema": {"type": ["string", "null"], "format": 
"password"},
+                        "description": "User account IAM token.",
+                    },
+                    "use_vm_metadata": {
+                        "label": "Use VM metadata",
+                        "schema": {"type": ["boolean", "null"], "default": 
False},
+                        "description": "Optional. Whether to use VM metadata 
to retrieve IAM token",
+                    },
+                },
+            }
         ],
     }

Reply via email to