Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RedshiftDataOperator not running in deferred mode when it should #41206

Merged
merged 9 commits into from
Aug 7, 2024
6 changes: 3 additions & 3 deletions airflow/providers/amazon/aws/operators/redshift_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def execute(self, context: Context) -> GetStatementResultResponseTypeDef | str:

# Set wait_for_completion to False so that it waits for the status in the deferred task.
wait_for_completion = self.wait_for_completion
if self.deferrable and self.wait_for_completion:
self.wait_for_completion = False
if self.deferrable:
wait_for_completion = False

self.statement_id = self.hook.execute_query(
database=self.database,
Expand All @@ -144,7 +144,7 @@ def execute(self, context: Context) -> GetStatementResultResponseTypeDef | str:
poll_interval=self.poll_interval,
)

if self.deferrable:
if self.deferrable and self.wait_for_completion:
is_finished = self.hook.check_query_is_finished(self.statement_id)
if not is_finished:
self.defer(
Expand Down