-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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: make dry run optional for patch task instance #34568
Conversation
This fixes an issue where dry_run is not actually and optional parameter in the patch task_instance api.
This is a reopened version of #34564 which was closed by mistake (by myself). |
I didn't want this comment to be forgotten: |
Hi @Calder-Ty, Thank you for addressing this issue and for reopening the pull request. Making dry_run optional and setting the default to False aligns the behavior of the code with the documentation, which will certainly prevent confusion and errors for API users in the future. It is crucial that the API's behavior is consistent with the documentation to ensure a smooth and reliable user experience, and this change is a step in the right direction. Looking at the commits, it seems you have kept the changes concise and directly related to the issue at hand, which is appreciated. It's also good to see that the checks have mostly passed, indicating that this change doesn't introduce any apparent regressions or new issues. I look forward to seeing this change merged after the required reviews, and I believe it will be a valuable improvement to Apache Airflow. Thank you again for your contribution! Best regards, |
@pierrejeambrun in the first PR, I commented with:
WDYT? If you agree, should we fix the doc and the bug in the same PR? |
Yes, all other
I think defaulting to true makes more sense, and is more conservative, unless explicitly stated by the user with a dry_run=False, we should run in dry run mode. Also just for a consistency reason, dry_run should be True. Updating the doc and the schema in one place will fix both endpoints mentioned. Yes this is a very small located change, updating both the schema and the API spec and putting this under bug fix seems fine to me :) |
This updates the docs and the code so that they are in alignment while also being consistent with all other endpoints. All other Endpoints have dry run set to be True by default.
made changes to have docs and code aligned, as well as be consistent with the rest of the API (i.e Set |
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.
We should only update here:
if not data["dry_run"]: |
data.get(‘dry_run’, False)
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.
LGTM, this is consistent with dry_run
default value for other endpoints. (And the more conservative choice, I believe)
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.
Other than the static check failures (should be an easy fix to the generated ts) it lgtm.
I like the fix in the schema!
Also, are we considering this change to the default a breaking change to the API or a bugfix? CC @eladkal |
Technically it is, however, I think we can be fairly sure no one was depending on the functionality since it was broken. |
Yep, what Hussein said, not a breaking change. (Field was required before) |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
* fix: Make dry_run optional per docs This fixes an issue where dry_run is not actually and optional parameter in the patch task_instance api. * chore: remove formatting changes * fix: Make changes for api docs This updates the docs and the code so that they are in alignment while also being consistent with all other endpoints. All other Endpoints have dry run set to be True by default. * fix: Update static ts file for api change * fix: Remove dump_default (cherry picked from commit a4357ca)
Fixes #34563. This sets Dry run to be optional as the docs indicate it should be and makes the default False per the docs.
^ 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.