-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Skip PythonVirtualenvOperator task when it returns a provided exit code #30690
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
Skip PythonVirtualenvOperator task when it returns a provided exit code #30690
Conversation
| templates_dict: dict | None = None, | ||
| templates_exts: list[str] | None = None, | ||
| expect_airflow: bool = True, | ||
| skip_exit_code: int | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m late but this name feels like it’s skipping the exit code; would it be better to name it e.g. skip_on_exit_code instead? Also would it be a good idea to allow multiple codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, good suggestions, I'll create a new PR to address them
…de (apache#30690) * Add a new argument to rais skip exception when the python callable exit with the same value * add unit tests for skip_exit_code
The change #apache#30690 and apache#30692 added skip_on_exit_code to the PythonVirtualenvOperator, but it skipped the - very closely related - ExternalPythonOperator. This change brings the same functionality to ExternalPythonOperator, moves it to the base class for both operators, it also adds separate Test class for ExternalPythonOperator, also introducing a common base class and moving the test methods that are common to both operators there.
The change ##30690 and #30692 added skip_on_exit_code to the PythonVirtualenvOperator, but it skipped the - very closely related - ExternalPythonOperator. This change brings the same functionality to ExternalPythonOperator, moves it to the base class for both operators, it also adds separate Test class for ExternalPythonOperator, also introducing a common base class and moving the test methods that are common to both operators there.
The change ##30690 and #30692 added skip_on_exit_code to the PythonVirtualenvOperator, but it skipped the - very closely related - ExternalPythonOperator. This change brings the same functionality to ExternalPythonOperator, moves it to the base class for both operators, it also adds separate Test class for ExternalPythonOperator, also introducing a common base class and moving the test methods that are common to both operators there. (cherry picked from commit 5ed4669)
Skip
PythonVirtualenvOperatortask when the python callable returns the exit codeskip_exit_codeprovided as an argument.