fix: bigquery root= in connection (#21154)

This commit is contained in:
Keshav Mohta 2025-05-15 01:13:20 +05:30 committed by GitHub
parent 7abbb73ae2
commit 199aec8d3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,9 +89,14 @@ def get_connection_url(connection: BigQueryConnection) -> str:
isinstance(connection.credentials.gcpConfig, GcpCredentialsPath)
and connection.credentials.gcpConfig.projectId
):
return (
f"{connection.scheme.value}://{connection.credentials.gcpConfig.projectId}"
)
if isinstance( # pylint: disable=no-else-return
connection.credentials.gcpConfig.projectId, SingleProjectId
):
return f"{connection.scheme.value}://{connection.credentials.gcpConfig.projectId.root}"
elif isinstance(connection.credentials.gcpConfig.projectId, MultipleProjectId):
for project_id in connection.credentials.gcpConfig.projectId.root:
return f"{connection.scheme.value}://{project_id}"
return f"{connection.scheme.value}://"