-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Fix cancel_on_kill after execution timeout for DataprocSubmitJobOperator #22955
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
Fix cancel_on_kill after execution timeout for DataprocSubmitJobOperator #22955
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 Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
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.
nice!
Static checks need fixing |
Thanks @potiuk! That's odd that |
Mypy does seem to work a bit "unstable'y" - I think I know why and might be we will soon fix it. |
3962a73
to
1818ff1
Compare
It's a bit sad that we need to have this additional |
I don't find it wrong. It's not to keep mypy happy, it's to make sure you don't accidentally use None. There is nothing wrong with the way you've done and it needs no explanation I think in this case Contraray to popular belief peeople should optimise their code for easines of reading and correctness not to "avoid" creating variables. Compileres and interpreters will optimise it away and creating extra, properly named variable is often much better solution than .. adding a comment about it. I often do that. In this case maybe even name it "new_job_id" and even expilcitly mark it as Comments are overrated on the other hand. |
Definitely 👍 Could you please clarify if you are ok with the current PR, or do you prefer to |
Add it - you will see that it's going to be cleaner. And then you can even move self.job_id = new_job_id closer to the end of the function - and separate variabe will suddenly make a lot more sense |
Synchronous tasks killed by execution timeout weren't canceled due to wrong assignment of job_id property.
1818ff1
to
79ac6f8
Compare
Thanks for the guidance @potiuk! 🙇 Ok, so this PR is approved and labeled with |
Awesome work, congrats on your first merged pull request! |
Done :) |
Awesome, thank you very much @potiuk 😄 |
Synchronous tasks killed by execution timeout weren't canceled
due to wrong assignment of job_id property.