-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
DataflowStartFlexTemplateOperator. Check for Dataflow job type each check cycle. #40584
DataflowStartFlexTemplateOperator. Check for Dataflow job type each check cycle. #40584
Conversation
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)
|
3b4f714
to
ca4f8f7
Compare
Thank you for the contribution! Is this new behavior the same in deferrable mode? |
@moiseenkov deferrable is a bit different, since only DONE/FAILED/STOPPED are terminal states and RUNNING isn't. airflow/airflow/providers/google/cloud/operators/dataflow.py Lines 652 to 661 in c5c50cc
airflow/airflow/providers/google/cloud/triggers/dataflow.py Lines 108 to 147 in 3583329
should change behavior & propagate |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
…heck cycle. (apache#40584) --------- Co-authored-by: Oleksandr Tkachov <oleksandr.tkachov@medecision.com>
With expected status is not set, _DataflowJobsController during first check sets terminal state for job like if it was BATCH.
airflow/airflow/providers/google/cloud/hooks/dataflow.py
Lines 419 to 426 in c5c50cc
self._expected_terminal_state = JOB_STATE_DONE
But it is common practice to use FlexTemplate for Datatflow job deployment, in that case job type could be set to STREAMING during job startup.
After streaming job is successfully started its state changed to
JOB_STATE_RUNNING
and flagis_streaming
equals toTrue
:following branch is executed:
airflow/airflow/providers/google/cloud/hooks/dataflow.py
Lines 435 to 439 in c5c50cc
which terminates operator with error because streaming is expected to have
expected_status
RUNNING and not DONE.After this change
expected_state
inferred each cycle using up-to-date job type.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.