For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
      • AstroFully-managed data operations, powered by Apache Airflow.
      • Astro Private CloudRun Airflow-as-a-service in your environment.
      • Professional ServicesExpert Airflow services for your enterprise's success.
    • Tools
      • Cosmos
      • Orbiter
      • CLI
      • AI SDK
      • Agents
      • Blueprint
      • UpdatesThe State of Airflow 2026See the insights from over 5,800 data practitioners in the full report. Download Now ➔
  • Customers
  • Docs
    • Insights
      • Blog
      • Webinars
      • Resource Library
      • Events
    • Education
      • Academy
      • What is Airflow?
  • Pricing
Get Started Free
    • Overview
        • Airflow ObjectStorage
        • Blueprint
        • Dag documentation
        • DAG Factory
        • PyCharm local development
        • SQL check operators
        • VSCode local development
    • Glossary

Product

  • Platform Overview
  • Astro
  • Astro Observe
  • Astro Private Cloud
  • Security & Trust
  • Pricing

Tools & Services

  • Cosmos
  • Docs
  • Professional Services
  • Product Updates

Use Cases

  • AI Ops
  • Data Observability
  • ETL/ELT
  • ML Ops
  • Operational Analytics
  • All Use Cases

Industries

  • Financial Services
  • Gaming
  • Retail
  • Manufacturing
  • Healthcare
  • All Industries

Resources

  • Academy
  • eBooks & Guides
  • Blog
  • Webinars
  • Events
  • The Data Flowcast Podcast
  • All Resources

Airflow

  • What is Airflow
  • Airflow on Astro
  • Airflow 3.0
  • Airflow Upgrades
  • Airflow Use Cases
  • Airflow 2.x End of Life

Company

  • Our Story
  • Customers
  • Newsroom
  • Careers
  • Contact

Support

  • Knowledge Base
  • Status
  • Contact Support
GitHubYouTubeLinkedInx
  • Legal
  • Privacy
  • Terms of Service
  • Consent Preferences

  • Do Not Sell or Share My Personal information
  • Limit the Use Of My Sensitive Personal Information

Apache Airflow®, Airflow, and the Airflow logo are trademarks of the Apache Software Foundation. Copyright © Astronomer 2026. All rights reserved.

LogoLogo
On this page
  • Before you start
  • Configure the Python interpreter
  • Write Airflow code with PyCharm
  • Manage Airflow Docker containers with PyCharm
  • See also
TutorialsWrite Dags

Develop Airflow DAGs locally with PyCharm

Edit this page
Built with

Info

This page has not yet been updated for Airflow 3. The concepts shown are relevant, but some code may need to be updated. If you run any examples, take care to update import statements and watch for any other breaking changes.

This example shows how to set up PyCharm for local development with Airflow and the Astro CLI. Setting up a local development environment allows you to iterate more quickly when developing DAGs by taking advantage of IDE features.

Before you start

Before trying this example, make sure you have:

  • PyCharm
  • The Astro CLI
  • An Astro project running locally on your computer. See Getting started with the Astro CLI

Configure the Python interpreter

To develop Airflow DAGs in PyCharm, you need to configure at least one Python interpreter. In this example you configure an interpreter using Docker, which allows you to write Python code and interact with running DAGs from within PyCharm.

  1. In your PyCharm preferences go to Build, Execution, Deployment >> Docker and specify how to connect to the Docker daemon. For more, see Connect to Docker.

  2. Go to Project: <your-project-name> >> Python Interpreter. Click the Add Interpreter button on the right, and then click On Docker:

    Interpreter settings

  3. In the window that appears, select Pull or use existing for the Image option. In the Image tag field, select the Docker image that your Airflow environment is running, then click Next.

    Image settings

  4. Wait for PyCharm to finish pulling the Docker image and then click Next.

    Image settings

  5. Ensure the System Interpreter is set to Python 3. By default this path will point to the location of Python 3 on the machine and should not need to be changed. Then, click Create.

    Image settings

  6. On the original Python Interpreter setup screen, ensure the Python interpreter is set to the docker image and click Apply, followed by OK.

    Image settings

Write Airflow code with PyCharm

After you configure PyCharm to use the correct interpreter for Airflow, you get multiple advantages like code autocompletion, identifying deprecated or unused imports, and error syntax highlighting.

PyCharm will show you when there are deprecated imports in your project:

Deprecated Imports

It can also alert you when an import is unused:

Unused Imports

Like with other Python projects, PyCharm will highlight syntax errors in your Airflow code:

Syntax Highlighting

Lastly, here is an example of PyCharm autocompleting code and showing built-in definitions:

Code Autocompletion

Manage Airflow Docker containers with PyCharm

With PyCharm configured to use the Python interpreter from Docker, you can connect to your Docker containers directly from PyCharm using the Services pane. If you do not see this pane, try pressing cmd+8.

Services

From the Services pane, start Docker by clicking the green play button. You’ll see the same containers appear as when you run docker ps after starting your Astro project locally:

Containers

View logs for the containers by clicking on /scheduler, /triggerer, /webserver, or /airflow-dev_2cd823-postgres. Note that these strings might differ based on where the parent directory for your project is located:

Logs

Run Airflow CLI commands by right clicking on /scheduler and selecting Create Terminal to bash into the container:

CLI

See also

  • Develop with VS Code
  • Debug interactively with dag.test()