Skip to content

airflowignore negation does not work in subfolders #58636

@devgonvarun

Description

@devgonvarun

Apache Airflow version

3.1.3

If "Other Airflow 2/3 version" selected, which one?

No response

What happened?

.airflowignore negation only works for files directly in the folder but not for subfolders.

*
!dag_to_appear.py

This works as expected as this is telling airflowignore to not ignore the file from the same folder.

However:

*
!subfolder/
!subfolder/dag_to_appear.py

This does not work. This is a valid pattern for .gitignore.

Similarly, the following also does not work but should work in principle following the same pattern of .gitignore.

*
!*/
!*/subfolder/
!*/subfolder/*

What you think should happen instead?

airflowignore negations should work also in the subfolders.

How to reproduce

Experiment with airflow ignore negations to ignore all and include only certain dag files first in current folder and then from subfolders.

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions