pankajastro commented on code in PR #30946:
URL: https://github.com/apache/airflow/pull/30946#discussion_r1181062264
##########
airflow/providers/google/cloud/sensors/bigquery.py:
##########
@@ -110,20 +110,24 @@ def poke(self, context: Context) -> bool:
def execute(self, context: Context) -> None:
"""Airflow runs this method on the worker and defers using the
trigger."""
- self.defer(
- timeout=timedelta(seconds=self.timeout),
- trigger=BigQueryTableExistenceTrigger(
- dataset_id=self.dataset_id,
- table_id=self.table_id,
- project_id=self.project_id,
- poll_interval=self.poke_interval,
- gcp_conn_id=self.gcp_conn_id,
- hook_params={
- "impersonation_chain": self.impersonation_chain,
- },
- ),
- method_name="execute_complete",
- )
+ if not self.deferrable:
+ super().execute(context)
+ else:
+ if not self.poke(context=context):
+ self.defer(
+ timeout=timedelta(seconds=self.timeout),
+ trigger=BigQueryTableExistenceTrigger(
+ dataset_id=self.dataset_id,
+ table_id=self.table_id,
+ project_id=self.project_id,
+ poll_interval=self.poke_interval,
+ gcp_conn_id=self.gcp_conn_id,
+ hook_params={
Review Comment:
I was looking at `BigQueryTableExistenceTrigger` and it has `hook_params`
param but it does not use it so does it make sense to remove it from here wdyt?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]