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

Add Tasks API endpoint tests for DAG without start_date #40881

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

omkar-foss
Copy link
Collaborator

@omkar-foss omkar-foss commented Jul 19, 2024

related: #40828


This PR adds tests to cover Tasks API endpoint cases where the DAG doesn't have a start_date and is defined with schedule=None (it's unscheduled). Tests in this PR support the fix in #40878.

Additionally, this PR fixes the Provider KeyError that occurs in breeze selective checks for API tests as mentioned in the comment below. Update: This is fixed in #40904.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Jul 19, 2024
Copy link

boring-cyborg bot commented Jul 19, 2024

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 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

@omkar-foss
Copy link
Collaborator Author

omkar-foss commented Jul 19, 2024

Build is failing due to a KeyError in breeze selective checks here. But this PR has only API-related tests (no Provider-related code changes).

Could this be a bug @potiuk? The breeze selective checks code is breaking here in this build, as candidate_test_types holds values API and Always so removing Providers throws the KeyError.

Update: I've fixed this KeyError issue in this PR so it can be tested and verified here itself. Let me know if I should move it to a PR of it's own. Thanks.

@potiuk
Copy link
Member

potiuk commented Jul 20, 2024

I separated out the fix in Breeze @omkar-foss (and did it slightly differently and added tests covering more cases). #40904

@potiuk
Copy link
Member

potiuk commented Jul 20, 2024

( I made you co-author)

potiuk added a commit to potiuk/airflow that referenced this pull request Jul 20, 2024
We were removing "Providers" from the list of candidates and
handled the key non-existing  but there were a path when splitting to
individual provider tests for "compatibility checks" was failing.

This is split from apache#40881 and test is added.

Co-authored-by: Omkar P <45419097+omkar-foss@users.noreply.github.com>
potiuk added a commit that referenced this pull request Jul 20, 2024
We were removing "Providers" from the list of candidates and
handled the key non-existing  but there were a path when splitting to
individual provider tests for "compatibility checks" was failing.

This is split from #40881 and test is added.

Co-authored-by: Omkar P <45419097+omkar-foss@users.noreply.github.com>
@potiuk
Copy link
Member

potiuk commented Jul 20, 2024

You can rebase on top of main and remove your changes - it should work now @omkar-foss

@omkar-foss
Copy link
Collaborator Author

omkar-foss commented Jul 20, 2024

Thanks for looking into this @potiuk. Done, I've rebased this PR with main and have removed the selective checks fix changes from this PR. Build is passing here, so #40904 looks to be working well ✅

@jedcunningham this is a tests-only PR supporting the change in your PR #40878, please have a look whenever you get a minute, thanks.

@potiuk potiuk merged commit 33461d2 into apache:main Jul 26, 2024
48 checks passed
Copy link

boring-cyborg bot commented Jul 26, 2024

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
…he#40904)

We were removing "Providers" from the list of candidates and
handled the key non-existing  but there were a path when splitting to
individual provider tests for "compatibility checks" was failing.

This is split from apache#40881 and test is added.

Co-authored-by: Omkar P <45419097+omkar-foss@users.noreply.github.com>
@omkar-foss omkar-foss deleted the tasks-test-unscheduled-dag branch July 31, 2024 20:36
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.

2 participants