Skip to content

Fix(Amazon): Restore wait_policy in EmrCreateJobFlowOperator#61373

Closed
dv-gorasiya wants to merge 2 commits intoapache:mainfrom
dv-gorasiya:feature/emr-wait-policy
Closed

Fix(Amazon): Restore wait_policy in EmrCreateJobFlowOperator#61373
dv-gorasiya wants to merge 2 commits intoapache:mainfrom
dv-gorasiya:feature/emr-wait-policy

Conversation

@dv-gorasiya
Copy link

Description
Restores the functionality of the wait_policy parameter in EmrCreateJobFlowOperator.
Previously, wait_policy was deprecated and ignored in favor of a hardcoded 'running' state check when wait_for_completion was True.
This change allows users to explicitly specify policies like WAIT_FOR_STEPS_COMPLETION (to wait for cluster termination) while maintaining backward compatibility (implied wait_for_completion=True).

Related Issue
Closes #61180

Tests
Added test_execute_with_wait_policy to verify the correct waiter is used.
Removed test_wait_policy_deprecation_warning as the parameter is no longer deprecated.

This restores the ability to specify a WaitPolicy (e.g. WAIT_FOR_STEPS_COMPLETION) instead of forcing the default 'running' state check. Closes apache#61180.
Verifies that the specified wait_policy is respected and the deprecated warning is removed.
@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Feb 3, 2026
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 3, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@phanikumv
Copy link
Contributor

Seems to be a duplicate of https://github.com/apache/airflow/pull/61195/changes?

@dv-gorasiya
Copy link
Author

Closing in favor of #61195, which covers the same fix and includes better test coverage and deferrable support. Thanks @phanikumv for pointing it out!

@dv-gorasiya dv-gorasiya closed this Feb 3, 2026
@dv-gorasiya dv-gorasiya deleted the feature/emr-wait-policy branch February 3, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wait_for_completion in EmrCreateJobFlorOperator should wait for the cluster to complete to return success

2 participants