Skip to main content

Use `.airflowignore` to ignore files in your Astro project

You can create an .airflowignore file in the dags directory of your Astro project to identify the files to ignore when you deploy to Astro or develop locally. This can be helpful if your team has a single Git repository that contains DAGs for multiple projects.

The .airflowignore file and the files listed in it must be in the same dags directory of your Astro project. The Airflow scheduler does not parse the files or directories listed in .airflowignore and the Airflow UI does not show DAGs listed in the file.

For more information about .airflowignore, see .airflowignore in the Airflow documentation. To learn more about the code deploy process, see What happens during a code deploy.

Setup

  1. In the dags directory of your Astro project, create a new file named .airflowignore.

  2. List the files or sub-directories you want ignored when you push code to Astro or when you are developing locally. You should list the path for each file or directory relative to the dags directory. For example:

    mydag.py
    data-team-dags
    some-dags/ignore-this-dag.py

    You can also use regular expressions to specify groups of files. See the Airflow documentation for more information about usage.

  3. Save your changes locally or deploy to Astro.

    Your local Airflow environment automatically updates as soon as you save your changes to .airflowignore. To apply your change in Astro, you need to deploy. See Deploy code.

Was this page helpful?