Skip to content

Commit

Permalink
Fix select * query xcom push for BigQueryGetDataOperator (#22936)
Browse files Browse the repository at this point in the history
Use in instead of get for conditinal check
  • Loading branch information
pankajastro committed Apr 13, 2022
1 parent a0f7e61 commit aa317d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,14 @@ def execute(self, context: 'Context') -> list:
impersonation_chain=self.impersonation_chain,
)

if not self.selected_fields:
schema: Dict[str, list] = hook.get_schema(
dataset_id=self.dataset_id,
table_id=self.table_id,
)
if "fields" in schema:
self.selected_fields = ','.join([field["name"] for field in schema["fields"]])

rows = hook.list_rows(
dataset_id=self.dataset_id,
table_id=self.table_id,
Expand Down

0 comments on commit aa317d9

Please sign in to comment.