You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "yunhobb (via GitHub)" <gi...@apache.org> on 2026/03/10 14:29:16 UTC
[PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
yunhobb opened a new pull request, #63274:
URL: https://github.com/apache/airflow/pull/63274
## Summary
- Add `skip_on_exit_code` parameter to `EcsRunTaskOperator`, allowing users to specify exit codes that should mark the task as skipped (`AirflowSkipException`) instead of failed.
- This is consistent with the existing `skip_on_exit_code` parameter in `DockerOperator` and `KubernetesPodOperator`.
- Accepts a single int or a container of ints (e.g., `skip_on_exit_code=2` or `skip_on_exit_code=[2, 3]`).
## Motivation
Currently, any non-zero exit code from an ECS task raises `AirflowException`. There is no way to skip a task based on a specific exit code, unlike `DockerOperator` and `KubernetesPodOperator` which already support this.
This was originally proposed in #47256 by @mariotaddeucci but went stale. This PR rebases the idea onto the current codebase and aligns the interface with DockerOperator and KubernetesPodOperator.
## Test plan
- [x] `test_check_success_task_raises_skip_exception` — exit code in `skip_on_exit_code` raises `AirflowSkipException`
- [x] `test_check_success_task_skip_exception_with_logs` — same behavior when CloudWatch logs are present
- [x] `test_check_success_task_unmatched_exit_code_raises_airflow_exception` — unmatched exit codes still raise `AirflowException`
- [x] All existing `TestEcsRunTaskOperator` tests pass
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code
Generated-by: Claude Code following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #63274:
URL: https://github.com/apache/airflow/pull/63274#issuecomment-4031840896
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]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-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](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) 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](https://www.apache.org/foundation/policies/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]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
- 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
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on PR #63274:
URL: https://github.com/apache/airflow/pull/63274#issuecomment-4032645311
Main was broken, can you please rebase?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #63274:
URL: https://github.com/apache/airflow/pull/63274#discussion_r2912450771
##########
airflow-core/newsfragments/63274.feature.rst:
##########
@@ -0,0 +1 @@
+Add ``skip_on_exit_code`` parameter to ``EcsRunTaskOperator``.
Review Comment:
All good :)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "yunhobb (via GitHub)" <gi...@apache.org>.
yunhobb commented on code in PR #63274:
URL: https://github.com/apache/airflow/pull/63274#discussion_r2912437368
##########
airflow-core/newsfragments/63274.feature.rst:
##########
@@ -0,0 +1 @@
+Add ``skip_on_exit_code`` parameter to ``EcsRunTaskOperator``.
Review Comment:
@vincbeck Thanks for pointing that out! Removed the newsfragment. I'm first time contributor so I didn't know that.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "yunhobb (via GitHub)" <gi...@apache.org>.
yunhobb commented on PR #63274:
URL: https://github.com/apache/airflow/pull/63274#issuecomment-4032666035
@vincbeck Rebased on the latest main. Thanks for letting me know!
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #63274:
URL: https://github.com/apache/airflow/pull/63274#issuecomment-4033069248
Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional contributions.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "mgrv-yunho (via GitHub)" <gi...@apache.org>.
mgrv-yunho commented on code in PR #63274:
URL: https://github.com/apache/airflow/pull/63274#discussion_r2912425745
##########
airflow-core/newsfragments/63274.feature.rst:
##########
@@ -0,0 +1 @@
+Add ``skip_on_exit_code`` parameter to ``EcsRunTaskOperator``.
Review Comment:
@vincbeck Thanks for pointing that out! Removed the newsfragment.
##########
airflow-core/newsfragments/63274.feature.rst:
##########
@@ -0,0 +1 @@
+Add ``skip_on_exit_code`` parameter to ``EcsRunTaskOperator``.
Review Comment:
@vincbeck Thanks for pointing that out! Removed the newsfragment.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #63274:
URL: https://github.com/apache/airflow/pull/63274#discussion_r2912394294
##########
airflow-core/newsfragments/63274.feature.rst:
##########
@@ -0,0 +1 @@
+Add ``skip_on_exit_code`` parameter to ``EcsRunTaskOperator``.
Review Comment:
We do not add newsfragments for providers
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add skip_on_exit_code support to EcsRunTaskOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck merged PR #63274:
URL: https://github.com/apache/airflow/pull/63274
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org