Skip to content

Fix _extract_template_fields mypy error - #53855

Merged
eladkal merged 1 commit into
apache:mainfrom
choo121600:fix/mypy-validate-operators-init
Aug 2, 2025
Merged

eladkal merged 1 commit into
apache:mainfrom
choo121600:fix/mypy-validate-operators-init

Conversation

@choo121600

Copy link
Copy Markdown
Member

This PR resolves an issue where the mypy-dev pre-commit hook fails during the CI process.

The Problem

When running in CI, the build failed with the following mypy error:

scripts/ci/pre_commit/validate_operators_init.py:63: error: List comprehension
has incompatible type List[str | bytes | int | float | complex | EllipsisType |
None]; expected List[str]  [misc]
image

Solution

# Before
return [elt.value for elt in class_item.value.elts if isinstance(elt, ast.Constant)]

# After
return [str(elt.value) for elt in class_item.value.elts if isinstance(elt, ast.Constant)]

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@eladkal
eladkal force-pushed the fix/mypy-validate-operators-init branch from 40c4eca to 8e3f91a Compare August 2, 2025 07:18
@eladkal
eladkal merged commit e809161 into apache:main Aug 2, 2025
github-actions Bot pushed a commit that referenced this pull request Aug 2, 2025
(cherry picked from commit e809161)

Co-authored-by: Yeonguk Choo <[email protected]>
@github-actions

github-actions Bot commented Aug 2, 2025

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-0-test

Status Branch Result
✅ v3-0-test PR Link

potiuk pushed a commit that referenced this pull request Aug 2, 2025
(cherry picked from commit e809161)

Co-authored-by: Yeonguk Choo <[email protected]>
@choo121600
choo121600 deleted the fix/mypy-validate-operators-init branch August 14, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants