Skip to content

dags folder not present in PYTHONPATH #53617

@widewing

Description

@widewing

Apache Airflow version

3.0.3

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

No response

What happened?

The DAGs folder is expected in PYTHONPATH, and we should be able to import modules in the folder, as specified in https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/modules_management.html
However after Airflow 3.0.2 the folder is no longer exist in PYTHONPATH and we cannot import modules in dag files.

What you think should happen instead?

No response

How to reproduce

  1. run airflow info, the dags folder is not be presented
Paths info
airflow_home    | /app                                                                                                                                                                                                                                                                     
system_path     | /opt/oracle/instantclient_19_5:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin                                                                                                                                                                              
python_path     | /usr/local/bin:/usr/lib64/python39.zip:/usr/lib64/python3.9:/usr/lib64/python3.9/lib-dynload:/usr/local/lib64/python3.9/site-packages:/usr/local/lib/python3.9/site-packages:/usr/lib64/python3.9/site-packages:/usr/lib/python3.9/site-packages:/app/config:/app/plugins
airflow_on_path | True
  1. Import a module in a dag file, the module should be in the dags folder. It will fail.

Operating System

rhel8

Versions of Apache Airflow Providers

No response

Deployment

Other 3rd-party Helm chart

Deployment details

No response

Anything else?

Related commit: b5db146

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions