Skip to content
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 per docs #34564

Closed
wants to merge 0 commits into from
Closed

Conversation

Calder-Ty
Copy link
Contributor

This fixes #34563. It makes SetSingleTaskInstanceStateFormSchema load dry_run as False by default.
This matches what is declared in the api 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.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Sep 22, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 22, 2023

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)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits 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 Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment 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 for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • 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

Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it's a problem in the doc, dry_run should be True by default.

Comment on lines 213 to 214
session.query(TaskInstance).update(
{TaskInstance.operator: None}, synchronize_session="fetch")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid unnecessary and unrelated changes

Suggested change
session.query(TaskInstance).update(
{TaskInstance.operator: None}, synchronize_session="fetch")
session.query(TaskInstance).update({TaskInstance.operator: None}, synchronize_session="fetch")

Copy link
Contributor Author

@Calder-Ty Calder-Ty Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy fix, will turn off my formatter

Comment on lines 316 to 317
self.create_task_instances(session, task_instances=[
{"state": State.REMOVED}], update_extras=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.create_task_instances(session, task_instances=[
{"state": State.REMOVED}], update_extras=True)
self.create_task_instances(session, task_instances=[{"state": State.REMOVED}], update_extras=True)

@@ -667,7 +669,8 @@ def test_should_respond_200_for_dag_id_filter(self, session):
)

assert response.status_code == 200
count = session.query(TaskInstance).filter(TaskInstance.dag_id == "example_python_operator").count()
count = session.query(TaskInstance).filter(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
count = session.query(TaskInstance).filter(
count = session.query(TaskInstance).filter(TaskInstance.dag_id == "example_python_operator").count()

@Calder-Ty
Copy link
Contributor Author

IMHO it's a problem in the doc, dry_run should be True by default.

I don't care about what the default is, however that change would technically be a breaking change. Albeit, no one can be depending on the declared functionality from the docs as it is broken.

@Calder-Ty
Copy link
Contributor Author

I did not mean to close this. But will open a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DryRun is not optional for patch task instance
2 participants