You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by el...@apache.org on 2025/08/02 08:11:09 UTC

(airflow) branch main updated: Fix `_extract_template_fields ` mypy error (#53855)

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

eladkal 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 e809161694b Fix `_extract_template_fields ` mypy error (#53855)
e809161694b is described below

commit e809161694b4bd99c265b08f6f701904599653f8
Author: Yeonguk Choo <ch...@gmail.com>
AuthorDate: Sat Aug 2 17:11:02 2025 +0900

    Fix `_extract_template_fields ` mypy error (#53855)
---
 scripts/ci/pre_commit/validate_operators_init.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/ci/pre_commit/validate_operators_init.py b/scripts/ci/pre_commit/validate_operators_init.py
index 0a5f58a9bf8..a8882545a86 100755
--- a/scripts/ci/pre_commit/validate_operators_init.py
+++ b/scripts/ci/pre_commit/validate_operators_init.py
@@ -60,14 +60,14 @@ def _extract_template_fields(class_node: ast.ClassDef) -> list[str]:
                     and target.id == "template_fields"
                     and isinstance(class_item.value, ast.Tuple)
                 ):
-                    return [elt.value for elt in class_item.value.elts if isinstance(elt, ast.Constant)]
+                    return [str(elt.value) for elt in class_item.value.elts if isinstance(elt, ast.Constant)]
         elif isinstance(class_item, ast.AnnAssign):
             if (
                 isinstance(class_item.target, ast.Name)
                 and class_item.target.id == "template_fields"
                 and isinstance(class_item.value, ast.Tuple)
             ):
-                return [elt.value for elt in class_item.value.elts if isinstance(elt, ast.Constant)]
+                return [str(elt.value) for elt in class_item.value.elts if isinstance(elt, ast.Constant)]
     return []