Skip to content

Conversation

@choo121600
Copy link
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.

@boring-cyborg boring-cyborg bot added area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Jul 29, 2025
@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
46 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 2, 2025
(cherry picked from commit e809161)

Co-authored-by: Yeonguk Choo <choo121600@gmail.com>
@github-actions
Copy link

github-actions bot commented Aug 2, 2025

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 <choo121600@gmail.com>
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
@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

Labels

area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants