gopidesupavan commented on code in PR #61880:
URL: https://github.com/apache/airflow/pull/61880#discussion_r2806087664


##########
airflow/models/dagrun.py:
##########
@@ -1648,9 +1648,25 @@ def schedule_tis(
         return count
 
     @provide_session
-    def get_log_template(self, *, session: Session = NEW_SESSION) -> 
LogTemplate | LogTemplatePydantic:
+    def get_db_log_template(self, *, session: Session = NEW_SESSION) -> 
LogTemplate | LogTemplatePydantic:
         return DagRun._get_log_template(log_template_id=self.log_template_id, 
session=session)
 
+    @provide_session
+    def get_log_template(
+        self, session: Session = NEW_SESSION
+    ) -> LogTemplate | LogTemplatePydantic | LogTemplateDataClass:
+        if airflow_conf.getboolean("core", 
"use_historical_filename_templates", fallback=False):
+            return self.get_db_log_template(session=session)
+        else:
+            return LogTemplateDataClass(
+                filename=airflow_conf.get_mandatory_value("core", 
"log_filename_template"),
+                elasticsearch_id=airflow_conf.get(
+                    "elasticsearch",
+                    "log_id_template",
+                    
fallback="{dag_id}-{task_id}-{run_id}-{map_index}-{try_number}",

Review Comment:
   is this needs to be {{ }}. like this? 



-- 
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