This is an automated email from the ASF dual-hosted git repository.

shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 674f39115da Remove unused log filename template renderer (#75780)
674f39115da is described below

commit 674f39115da2c35b6dc31f029b1ebc4a481c8079
Author: Hussein Awala <[email protected]>
AuthorDate: Tue Oct 27 22:03:32 2026 +0100

    Remove unused log filename template renderer (#75780)
    
    FileTaskHandler owns the active log filename rendering path. The unused 
alternative adds a second implementation and exclusive imports without a 
production or test caller.
---
 airflow-core/src/airflow/utils/helpers.py | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/airflow-core/src/airflow/utils/helpers.py 
b/airflow-core/src/airflow/utils/helpers.py
index e67f7a509af..51691a2dce1 100644
--- a/airflow-core/src/airflow/utils/helpers.py
+++ b/airflow-core/src/airflow/utils/helpers.py
@@ -22,7 +22,6 @@ import itertools
 import re
 import signal
 from collections.abc import Callable, Generator, Iterable, MutableMapping
-from functools import cache
 from typing import TYPE_CHECKING, Any, TypeVar, overload
 from urllib.parse import urljoin
 
@@ -38,8 +37,6 @@ if TYPE_CHECKING:
     import jinja2
     from typing_extensions import TypeIs
 
-    from airflow.models.taskinstance import TaskInstance
-
     CT = TypeVar("CT", str, datetime)
 
 KEY_REGEX = re.compile(r"^[\w.-]+$")
@@ -141,26 +138,6 @@ def parse_template_string(template_string: str) -> 
tuple[str, None] | tuple[None
     return template_string, None
 
 
-@cache
-def log_filename_template_renderer() -> Callable[..., str]:
-    template = conf.get("logging", "log_filename_template")
-
-    if "{{" in template:
-        import jinja2
-
-        return jinja2.Template(template).render
-
-    def f_str_format(ti: TaskInstance, try_number: int | None = None):
-        return template.format(
-            dag_id=ti.dag_id,
-            task_id=ti.task_id,
-            logical_date=ti.logical_date.isoformat(),
-            try_number=try_number or ti.try_number,
-        )
-
-    return f_str_format
-
-
 def convert_camel_to_snake(camel_str: str) -> str:
     """Convert CamelCase to snake_case."""
     return CAMELCASE_TO_SNAKE_CASE_REGEX.sub(r"_\1", camel_str).lower()

Reply via email to