Skip to content

Deactivate DAGs deleted from within zipfiles#30608

Merged
uranusjr merged 3 commits into
apache:mainfrom
luos-fc:fix-zipped-dag-deactivation
Apr 13, 2023
Merged

Deactivate DAGs deleted from within zipfiles#30608
uranusjr merged 3 commits into
apache:mainfrom
luos-fc:fix-zipped-dag-deactivation

Conversation

@luos-fc

@luos-fc luos-fc commented Apr 12, 2023

Copy link
Copy Markdown
Contributor

This PR updates the logic for deactivating deleted DAGs to check if the DAG file within a zip has been deleted, not just checking if the zip has been deleted.

A test has been added which fails against main, but succeeds with the new changes.
Closes #30600

@boring-cyborg boring-cyborg Bot added the area:Scheduler including HA (high availability) scheduler label Apr 12, 2023
@boring-cyborg

boring-cyborg Bot commented Apr 12, 2023

Copy link
Copy Markdown

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.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@luos-fc
luos-fc force-pushed the fix-zipped-dag-deactivation branch from 61eeb9b to 5262b6d Compare April 12, 2023 18:28
@luos-fc
luos-fc force-pushed the fix-zipped-dag-deactivation branch from 5262b6d to 97c3942 Compare April 12, 2023 18:55
Comment thread airflow/models/dag.py
@uranusjr
uranusjr merged commit 7609021 into apache:main Apr 13, 2023
@boring-cyborg

boring-cyborg Bot commented Apr 13, 2023

Copy link
Copy Markdown

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

uranusjr added a commit to astronomer/airflow that referenced this pull request Apr 13, 2023
I identified when reviewing apache#30608 that the _refresh_dag_dir() function
can use some cleanup, mainly to use a set instead of list to speed up
lookup. To maintain backward comaptibility in typ hints, the called
functions are changed to use the Collection generic instead of the very
narrow list type.

This somehow triggers a bunch of (legistimate) Mypy errors not emitted
previously, mostly around mixing the os.PathLike generic and the
pathlib.Path concrete type. I fixed those as well.
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Apr 14, 2023
uranusjr added a commit to astronomer/airflow that referenced this pull request Jun 21, 2023
I identified when reviewing apache#30608 that the _refresh_dag_dir() function
can use some cleanup, mainly to use a set instead of list to speed up
lookup. To maintain backward comaptibility in typ hints, the called
functions are changed to use the Collection generic instead of the very
narrow list type.

This somehow triggers a bunch of (legistimate) Mypy errors not emitted
previously, mostly around mixing the os.PathLike generic and the
pathlib.Path concrete type. I fixed those as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DAGs deleted from zips aren't deactivated

3 participants