Skip to content

Commit

Permalink
Add template fields renderers to Biguery and Dataproc operators (#12067)
Browse files Browse the repository at this point in the history
  • Loading branch information
turbaszek committed Nov 4, 2020
1 parent d971c1c commit 5f5244b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion airflow/providers/google/cloud/operators/bigquery.py
Expand Up @@ -879,7 +879,7 @@ class BigQueryCreateEmptyTableOperator(BaseOperator):
'view',
'impersonation_chain',
)

template_fields_renderers = {"table_resource": "json"}
ui_color = BigQueryUIColors.TABLE.value

# pylint: disable=too-many-arguments
Expand Down Expand Up @@ -1074,6 +1074,7 @@ class BigQueryCreateExternalTableOperator(BaseOperator):
'table_resource',
'impersonation_chain',
)
template_fields_renderers = {"table_resource": "json"}
ui_color = BigQueryUIColors.TABLE.value

# pylint: disable=too-many-arguments,too-many-locals
Expand Down Expand Up @@ -1369,6 +1370,7 @@ class BigQueryCreateEmptyDatasetOperator(BaseOperator):
'dataset_reference',
'impersonation_chain',
)
template_fields_renderers = {"dataset_reference": "json"}
ui_color = BigQueryUIColors.DATASET.value

@apply_defaults
Expand Down Expand Up @@ -1615,6 +1617,7 @@ class BigQueryPatchDatasetOperator(BaseOperator):
'project_id',
'impersonation_chain',
)
template_fields_renderers = {"dataset_resource": "json"}
ui_color = BigQueryUIColors.DATASET.value

@apply_defaults
Expand Down Expand Up @@ -1705,6 +1708,7 @@ class BigQueryUpdateDatasetOperator(BaseOperator):
'project_id',
'impersonation_chain',
)
template_fields_renderers = {"dataset_resource": "json"}
ui_color = BigQueryUIColors.DATASET.value

@apply_defaults
Expand Down Expand Up @@ -1876,6 +1880,7 @@ class BigQueryUpsertTableOperator(BaseOperator):
'table_resource',
'impersonation_chain',
)
template_fields_renderers = {"table_resource": "json"}
ui_color = BigQueryUIColors.TABLE.value

@apply_defaults
Expand Down Expand Up @@ -1993,6 +1998,7 @@ class BigQueryInsertJobOperator(BaseOperator):
"impersonation_chain",
)
template_ext = (".json",)
template_fields_renderers = {"configuration": "json"}
ui_color = BigQueryUIColors.QUERY.value

def __init__(
Expand Down
1 change: 1 addition & 0 deletions airflow/providers/google/cloud/operators/dataproc.py
Expand Up @@ -1699,6 +1699,7 @@ class DataprocInstantiateInlineWorkflowTemplateOperator(BaseOperator):
"""

template_fields = ['template', 'impersonation_chain']
template_fields_renderers = {"template": "json"}

@apply_defaults
def __init__(
Expand Down

0 comments on commit 5f5244b

Please sign in to comment.