Skip to content

Fix Apache Beam hook type error with mypy 2.2.0 typeshed#69946

Merged
Lee-W merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-fix-mypy-2.2.0
Jul 16, 2026
Merged

Fix Apache Beam hook type error with mypy 2.2.0 typeshed#69946
Lee-W merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-fix-mypy-2.2.0

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Why

  • The daily CI environment upgrade (#69694) bumps mypy 2.1.0 → 2.2.0, and MyPy providers checks fails on it.
    providers/apache/beam/src/airflow/providers/apache/beam/hooks/beam.py:184: error: Value of type variable "_R" of "select" cannot be "IO[Any] | None"  [type-var]
                readable_fds, _, _ = select.select(reads, [], [], 5)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Found 1 error in 1 file (checked 4688 source files)

How

  • Filter out None before passing the descriptors to select.select.

Verification

breeze run --python 3.10 --backend none --tty disabled bash -c "
  uv pip install --system -q mypy==2.2.0
  cd /opt/airflow
  mypy providers/apache/beam/src/airflow/providers/apache/beam/hooks/beam.py
"

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Signed-off-by: PoAn Yang <payang@apache.org>
@Lee-W
Lee-W merged commit 9bee629 into apache:main Jul 16, 2026
152 checks passed
@FrankYang0529
FrankYang0529 deleted the airflow-fix-mypy-2.2.0 branch July 16, 2026 06:39
joshuabvarghese pushed a commit to joshuabvarghese/airflow that referenced this pull request Jul 16, 2026
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.

2 participants