Skip to content

Commit 2387269

Browse files
amoghrajeshAnkurdeewan
authored andcommitted
Add missing conn-fields for providers migrated to yaml (apache#62116)
1 parent 7e6bec3 commit 2387269

File tree

9 files changed

+1063
-46
lines changed

9 files changed

+1063
-46
lines changed

providers/google/provider.yaml

Lines changed: 115 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,63 +1131,62 @@ connection-types:
11311131
project:
11321132
label: "Project Id"
11331133
schema:
1134-
type: string
1134+
type: ["string", "null"]
11351135
key_path:
11361136
label: "Keyfile Path"
11371137
schema:
1138-
type: string
1138+
type: ["string", "null"]
11391139
keyfile_dict:
11401140
label: "Keyfile JSON"
11411141
schema:
1142-
type: string
1142+
type: ["string", "null"]
11431143
format: password
11441144
credential_config_file:
11451145
label: "Credential Configuration File"
11461146
schema:
1147-
type: string
1147+
type: ["string", "null"]
11481148
scope:
11491149
label: "Scopes (comma separated)"
11501150
schema:
1151-
type: string
1151+
type: ["string", "null"]
11521152
key_secret_name:
11531153
label: "Keyfile Secret Name (in GCP Secret Manager)"
11541154
schema:
1155-
type: string
1155+
type: ["string", "null"]
11561156
key_secret_project_id:
11571157
label: "Keyfile Secret Project Id (in GCP Secret Manager)"
11581158
schema:
1159-
type: string
1159+
type: ["string", "null"]
11601160
num_retries:
11611161
label: "Number of Retries"
11621162
schema:
1163-
type: integer
1164-
minimum: 0
1163+
type: ["integer", "null"]
11651164
default: 5
11661165
impersonation_chain:
11671166
label: "Impersonation Chain"
11681167
schema:
1169-
type: string
1168+
type: ["string", "null"]
11701169
idp_issuer_url:
11711170
label: "IdP Token Issue URL (Client Credentials Grant Flow)"
11721171
schema:
1173-
type: string
1172+
type: ["string", "null"]
11741173
client_id:
11751174
label: "Client ID (Client Credentials Grant Flow)"
11761175
schema:
1177-
type: string
1176+
type: ["string", "null"]
11781177
client_secret:
11791178
label: "Client Secret (Client Credentials Grant Flow)"
11801179
schema:
1181-
type: string
1180+
type: ["string", "null"]
11821181
format: password
11831182
idp_extra_parameters:
11841183
label: "IdP Extra Request Parameters"
11851184
schema:
1186-
type: string
1185+
type: ["string", "null"]
11871186
is_anonymous:
11881187
label: "Anonymous credentials (ignores all other settings)"
11891188
schema:
1190-
type: boolean
1189+
type: ["boolean", "null"]
11911190
default: false
11921191
- hook-class-name: airflow.providers.google.cloud.hooks.dataprep.GoogleDataprepHook
11931192
connection-type: dataprep
@@ -1201,6 +1200,88 @@ connection-types:
12011200
hidden-fields: ["host", "schema", "login", "password", "port", "extra"]
12021201
relabeling: {}
12031202
placeholders: {}
1203+
conn-fields:
1204+
project:
1205+
label: "Project Id"
1206+
schema:
1207+
type: ["string", "null"]
1208+
key_path:
1209+
label: "Keyfile Path"
1210+
schema:
1211+
type: ["string", "null"]
1212+
keyfile_dict:
1213+
label: "Keyfile JSON"
1214+
schema:
1215+
type: ["string", "null"]
1216+
format: password
1217+
credential_config_file:
1218+
label: "Credential Configuration File"
1219+
schema:
1220+
type: ["string", "null"]
1221+
scope:
1222+
label: "Scopes (comma separated)"
1223+
schema:
1224+
type: ["string", "null"]
1225+
key_secret_name:
1226+
label: "Keyfile Secret Name (in GCP Secret Manager)"
1227+
schema:
1228+
type: ["string", "null"]
1229+
key_secret_project_id:
1230+
label: "Keyfile Secret Project Id (in GCP Secret Manager)"
1231+
schema:
1232+
type: ["string", "null"]
1233+
num_retries:
1234+
label: "Number of Retries"
1235+
schema:
1236+
type: ["integer", "null"]
1237+
default: 5
1238+
impersonation_chain:
1239+
label: "Impersonation Chain"
1240+
schema:
1241+
type: ["string", "null"]
1242+
idp_issuer_url:
1243+
label: "IdP Token Issue URL (Client Credentials Grant Flow)"
1244+
schema:
1245+
type: ["string", "null"]
1246+
client_id:
1247+
label: "Client ID (Client Credentials Grant Flow)"
1248+
schema:
1249+
type: ["string", "null"]
1250+
client_secret:
1251+
label: "Client Secret (Client Credentials Grant Flow)"
1252+
schema:
1253+
type: ["string", "null"]
1254+
format: password
1255+
idp_extra_parameters:
1256+
label: "IdP Extra Request Parameters"
1257+
schema:
1258+
type: ["string", "null"]
1259+
is_anonymous:
1260+
label: "Anonymous credentials (ignores all other settings)"
1261+
schema:
1262+
type: ["boolean", "null"]
1263+
default: false
1264+
use_legacy_sql:
1265+
label: "Use Legacy SQL"
1266+
schema:
1267+
type: ["boolean", "null"]
1268+
location:
1269+
label: "Location"
1270+
schema:
1271+
type: ["string", "null"]
1272+
priority:
1273+
label: "Priority"
1274+
schema:
1275+
type: ["string", "null"]
1276+
default: INTERACTIVE
1277+
api_resource_configs:
1278+
label: "API Resource Configs"
1279+
schema:
1280+
type: ["string", "null"]
1281+
labels:
1282+
label: "Labels"
1283+
schema:
1284+
type: ["string", "null"]
12041285
- hook-class-name: airflow.providers.google.cloud.hooks.compute_ssh.ComputeEngineSSHHook
12051286
connection-type: gcpssh
12061287
ui-field-behaviour:
@@ -1216,6 +1297,25 @@ connection-types:
12161297
relabeling: {}
12171298
placeholders:
12181299
password: "Leave blank (optional)"
1300+
conn-fields:
1301+
developer_token:
1302+
label: "Developer token"
1303+
schema:
1304+
type: ["string", "null"]
1305+
client_id:
1306+
label: "OAuth2 Client ID"
1307+
schema:
1308+
type: ["string", "null"]
1309+
client_secret:
1310+
label: "OAuth2 Client Secret"
1311+
schema:
1312+
type: ["string", "null"]
1313+
format: password
1314+
refresh_token:
1315+
label: "OAuth2 Refresh Token"
1316+
schema:
1317+
type: ["string", "null"]
1318+
format: password
12191319
- hook-class-name: airflow.providers.google.cloud.hooks.looker.LookerHook
12201320
connection-type: gcp_looker
12211321

providers/google/src/airflow/providers/google/get_provider_info.py

Lines changed: 89 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,49 +1373,52 @@ def get_provider_info():
13731373
"placeholders": {},
13741374
},
13751375
"conn-fields": {
1376-
"project": {"label": "Project Id", "schema": {"type": "string"}},
1377-
"key_path": {"label": "Keyfile Path", "schema": {"type": "string"}},
1376+
"project": {"label": "Project Id", "schema": {"type": ["string", "null"]}},
1377+
"key_path": {"label": "Keyfile Path", "schema": {"type": ["string", "null"]}},
13781378
"keyfile_dict": {
13791379
"label": "Keyfile JSON",
1380-
"schema": {"type": "string", "format": "password"},
1380+
"schema": {"type": ["string", "null"], "format": "password"},
13811381
},
13821382
"credential_config_file": {
13831383
"label": "Credential Configuration File",
1384-
"schema": {"type": "string"},
1384+
"schema": {"type": ["string", "null"]},
13851385
},
1386-
"scope": {"label": "Scopes (comma separated)", "schema": {"type": "string"}},
1386+
"scope": {"label": "Scopes (comma separated)", "schema": {"type": ["string", "null"]}},
13871387
"key_secret_name": {
13881388
"label": "Keyfile Secret Name (in GCP Secret Manager)",
1389-
"schema": {"type": "string"},
1389+
"schema": {"type": ["string", "null"]},
13901390
},
13911391
"key_secret_project_id": {
13921392
"label": "Keyfile Secret Project Id (in GCP Secret Manager)",
1393-
"schema": {"type": "string"},
1393+
"schema": {"type": ["string", "null"]},
13941394
},
13951395
"num_retries": {
13961396
"label": "Number of Retries",
1397-
"schema": {"type": "integer", "minimum": 0, "default": 5},
1397+
"schema": {"type": ["integer", "null"], "default": 5},
1398+
},
1399+
"impersonation_chain": {
1400+
"label": "Impersonation Chain",
1401+
"schema": {"type": ["string", "null"]},
13981402
},
1399-
"impersonation_chain": {"label": "Impersonation Chain", "schema": {"type": "string"}},
14001403
"idp_issuer_url": {
14011404
"label": "IdP Token Issue URL (Client Credentials Grant Flow)",
1402-
"schema": {"type": "string"},
1405+
"schema": {"type": ["string", "null"]},
14031406
},
14041407
"client_id": {
14051408
"label": "Client ID (Client Credentials Grant Flow)",
1406-
"schema": {"type": "string"},
1409+
"schema": {"type": ["string", "null"]},
14071410
},
14081411
"client_secret": {
14091412
"label": "Client Secret (Client Credentials Grant Flow)",
1410-
"schema": {"type": "string", "format": "password"},
1413+
"schema": {"type": ["string", "null"], "format": "password"},
14111414
},
14121415
"idp_extra_parameters": {
14131416
"label": "IdP Extra Request Parameters",
1414-
"schema": {"type": "string"},
1417+
"schema": {"type": ["string", "null"]},
14151418
},
14161419
"is_anonymous": {
14171420
"label": "Anonymous credentials (ignores all other settings)",
1418-
"schema": {"type": "boolean", "default": False},
1421+
"schema": {"type": ["boolean", "null"], "default": False},
14191422
},
14201423
},
14211424
},
@@ -1439,6 +1442,66 @@ def get_provider_info():
14391442
"relabeling": {},
14401443
"placeholders": {},
14411444
},
1445+
"conn-fields": {
1446+
"project": {"label": "Project Id", "schema": {"type": ["string", "null"]}},
1447+
"key_path": {"label": "Keyfile Path", "schema": {"type": ["string", "null"]}},
1448+
"keyfile_dict": {
1449+
"label": "Keyfile JSON",
1450+
"schema": {"type": ["string", "null"], "format": "password"},
1451+
},
1452+
"credential_config_file": {
1453+
"label": "Credential Configuration File",
1454+
"schema": {"type": ["string", "null"]},
1455+
},
1456+
"scope": {"label": "Scopes (comma separated)", "schema": {"type": ["string", "null"]}},
1457+
"key_secret_name": {
1458+
"label": "Keyfile Secret Name (in GCP Secret Manager)",
1459+
"schema": {"type": ["string", "null"]},
1460+
},
1461+
"key_secret_project_id": {
1462+
"label": "Keyfile Secret Project Id (in GCP Secret Manager)",
1463+
"schema": {"type": ["string", "null"]},
1464+
},
1465+
"num_retries": {
1466+
"label": "Number of Retries",
1467+
"schema": {"type": ["integer", "null"], "default": 5},
1468+
},
1469+
"impersonation_chain": {
1470+
"label": "Impersonation Chain",
1471+
"schema": {"type": ["string", "null"]},
1472+
},
1473+
"idp_issuer_url": {
1474+
"label": "IdP Token Issue URL (Client Credentials Grant Flow)",
1475+
"schema": {"type": ["string", "null"]},
1476+
},
1477+
"client_id": {
1478+
"label": "Client ID (Client Credentials Grant Flow)",
1479+
"schema": {"type": ["string", "null"]},
1480+
},
1481+
"client_secret": {
1482+
"label": "Client Secret (Client Credentials Grant Flow)",
1483+
"schema": {"type": ["string", "null"], "format": "password"},
1484+
},
1485+
"idp_extra_parameters": {
1486+
"label": "IdP Extra Request Parameters",
1487+
"schema": {"type": ["string", "null"]},
1488+
},
1489+
"is_anonymous": {
1490+
"label": "Anonymous credentials (ignores all other settings)",
1491+
"schema": {"type": ["boolean", "null"], "default": False},
1492+
},
1493+
"use_legacy_sql": {"label": "Use Legacy SQL", "schema": {"type": ["boolean", "null"]}},
1494+
"location": {"label": "Location", "schema": {"type": ["string", "null"]}},
1495+
"priority": {
1496+
"label": "Priority",
1497+
"schema": {"type": ["string", "null"], "default": "INTERACTIVE"},
1498+
},
1499+
"api_resource_configs": {
1500+
"label": "API Resource Configs",
1501+
"schema": {"type": ["string", "null"]},
1502+
},
1503+
"labels": {"label": "Labels", "schema": {"type": ["string", "null"]}},
1504+
},
14421505
},
14431506
{
14441507
"hook-class-name": "airflow.providers.google.cloud.hooks.compute_ssh.ComputeEngineSSHHook",
@@ -1461,6 +1524,18 @@ def get_provider_info():
14611524
"relabeling": {},
14621525
"placeholders": {"password": "Leave blank (optional)"},
14631526
},
1527+
"conn-fields": {
1528+
"developer_token": {"label": "Developer token", "schema": {"type": ["string", "null"]}},
1529+
"client_id": {"label": "OAuth2 Client ID", "schema": {"type": ["string", "null"]}},
1530+
"client_secret": {
1531+
"label": "OAuth2 Client Secret",
1532+
"schema": {"type": ["string", "null"], "format": "password"},
1533+
},
1534+
"refresh_token": {
1535+
"label": "OAuth2 Refresh Token",
1536+
"schema": {"type": ["string", "null"], "format": "password"},
1537+
},
1538+
},
14641539
},
14651540
{
14661541
"hook-class-name": "airflow.providers.google.cloud.hooks.looker.LookerHook",

0 commit comments

Comments
 (0)