Created
June 16, 2022 08:41
-
-
Save mesmacosta/c552ea8ff71e195c9c43c552d5a2f169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def execute(self, context: 'Context'): | |
# ... code suppresed for readability | |
if isinstance(self.sql, str): | |
job_id: Union[str, List[str]] = self.hook.run_query( | |
sql=self.sql, | |
destination_dataset_table=self.destination_dataset_table, | |
write_disposition=self.write_disposition, | |
allow_large_results=self.allow_large_results, | |
flatten_results=self.flatten_results, | |
udf_config=self.udf_config, | |
maximum_billing_tier=self.maximum_billing_tier, | |
maximum_bytes_billed=self.maximum_bytes_billed, | |
create_disposition=self.create_disposition, | |
query_params=self.query_params, | |
labels=self.labels, | |
schema_update_options=self.schema_update_options, | |
priority=self.priority, | |
time_partitioning=self.time_partitioning, | |
api_resource_configs=self.api_resource_configs, | |
cluster_fields=self.cluster_fields, | |
encryption_configuration=self.encryption_configuration, | |
) | |
# ... code suppresed for readability | |
context['task_instance'].xcom_push(key='job_id', value=job_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment