Skip DockerOperator task when it returns a provided exit code#28996
Skip DockerOperator task when it returns a provided exit code#28996potiuk merged 6 commits intoapache:mainfrom
Conversation
| log_opts_max_size: str | None = None, | ||
| log_opts_max_file: str | None = None, | ||
| ipc_mode: str | None = None, | ||
| skip_exit_code: int = 99, |
There was a problem hiding this comment.
Just a question. Should we actually provide any default value for that? Or is it user responsibility?
In theory some current users pipelines might return 99 status code
There was a problem hiding this comment.
I agree, I just used the same default value used in the BashOperator
There was a problem hiding this comment.
I don't think it make sense to copy default value from BashOperator.
There was a problem hiding this comment.
And also we need to specify annotation as int | None it is not raise any static checks because we have default value 99 however user might provide None and this is expected value in execute
| ({"skip_exit_code": None}, 99, AirflowException), | ||
| ] | ||
| ) | ||
| def test_skip(self, extra_kwargs, actual_exit_code, expected_exc): |
There was a problem hiding this comment.
Would be nice also add this kind of test to docker decorator
Right now docker decorator tests run under non-mocked environment
Co-authored-by: Andrey Anshin <Andrey.Anshin@taragol.is>
Co-authored-by: Andrey Anshin <Andrey.Anshin@taragol.is>
closes: #28951
^ Add meaningful description above
Skip
DockerOperatortask when the container returns the exit codeskip_exit_codeprovided as an argument.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.rstor{issue_number}.significant.rst, in newsfragments.