suhail-zemoso commented on issue #53617:
URL: https://github.com/apache/airflow/issues/53617#issuecomment-3126368940

   ✅ Workarounds to Resolve the Issue
   We’ve identified a few workarounds for the missing PYTHONPATH entry for the 
dags/ folder in Airflow 3.x:
   
   Option 1 (✅ Recommended)
   Move your custom module to a separate directory:
   
   Preferably place it inside the plugins/ folder (which is already included in 
sys.path),
   OR
   
   Create a new directory (e.g., libs/) and manually add it to the PYTHONPATH 
(e.g., via environment variable or modifying sys.path).
   
   Option 2 (Migration Support)
   If you're migrating from Airflow 2.x and have already placed custom modules 
inside the dags/ folder:
   
   You can continue using them only if you explicitly add the dags/ directory 
to the PYTHONPATH.
   
   Option 3 (Dev Only)
   If you're using the Breeze development environment, /files/dags is 
implicitly added to sys.path at both parse time and runtime.
   ⚠️ Note: This behavior is specific to Breeze and should not be relied on in 
production.
   
   📌 Rationale
   1. Keeping custom modules outside the dags/ folder promotes separation of 
concerns between DAG definitions and business logic.
   
   2. It improves modularity, reusability, and testability of your Python code.
   
   3. Avoids relying on environment-specific behavior — especially important 
because /dags being added to sys.path works in Breeze but fails silently in 
other production-like deployments.
   
   @potiuk Can we add these as documentation?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to