Brunda10 commented on code in PR #54256:
URL: https://github.com/apache/airflow/pull/54256#discussion_r2278498613
##########
airflow-core/src/airflow/config_templates/config.yml:
##########
@@ -509,6 +509,19 @@ core:
type: string
example: ~
default: ~
+ template_searchpath:
+ description: |
+ Path where Airflow looks for Jinja templates used in DAGs and task
fields.
+ Can be a single absolute path (string) or a comma-separated list of
multiple
+ absolute paths.
+ When multiple paths are specified, Airflow searches them in the
provided order
+ until the requested template file is found. Relative paths are
resolved against
+ `AIRFLOW_HOME`.
+ version_added: ~
+ type: string
+ example: "/opt/airflow/dags/templates,/opt/airflow/cutom_templates"
+ default: "{AIRFLOW_HOME}/dags/include"
Review Comment:
The {AIRFLOW_HOME}/dags/include default came from the common convention
(https://github.com/apache/airflow/issues/53972) where shared templates are
stored in an include/ folder alongside DAGs.
While upgrading to Airflow 3, we ran into the exact problem described in the
issue — after moving SQL templates to include/, DAGs couldn’t find them unless
we set template_searchpath explicitly in every DAG.
The default path just reflects that convention, but it’s configurable — so
if we prefer a different folder or want to keep it empty by default, I can
adjust it.
--
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]