Pass --use_cloud_function to get_schema_from_table (#3442)
This commit is contained in:
Родитель
49fb0d5fb3
Коммит
cd48f7c09c
|
@ -1482,7 +1482,11 @@ def _update_query_schema(
|
|||
pass
|
||||
|
||||
table_schema = Schema.for_table(
|
||||
project_name, dataset_name, table_name, partitioned_by
|
||||
project_name,
|
||||
dataset_name,
|
||||
table_name,
|
||||
partitioned_by,
|
||||
use_cloud_function=use_cloud_function,
|
||||
)
|
||||
|
||||
changed = True
|
||||
|
|
|
@ -57,7 +57,7 @@ class Schema:
|
|||
return cls(json_schema)
|
||||
|
||||
@classmethod
|
||||
def for_table(cls, project, dataset, table, partitioned_by=None):
|
||||
def for_table(cls, project, dataset, table, partitioned_by=None, *args, **kwargs):
|
||||
"""Get the schema for a BigQuery table."""
|
||||
query = f"SELECT * FROM `{project}.{dataset}.{table}`"
|
||||
|
||||
|
@ -67,7 +67,10 @@ class Schema:
|
|||
try:
|
||||
return cls(
|
||||
dryrun.DryRun(
|
||||
os.path.join(project, dataset, table, "query.sql"), query
|
||||
os.path.join(project, dataset, table, "query.sql"),
|
||||
query,
|
||||
*args,
|
||||
**kwargs,
|
||||
).get_schema()
|
||||
)
|
||||
except Exception as e:
|
||||
|
|
Загрузка…
Ссылка в новой задаче