Skip to content

Pass parameters to k8s methods conditionally to fix mypy#64242

Merged
eladkal merged 2 commits intoapache:mainfrom
amoghrajesh:mypy-k8s
Mar 26, 2026
Merged

Pass parameters to k8s methods conditionally to fix mypy#64242
eladkal merged 2 commits intoapache:mainfrom
amoghrajesh:mypy-k8s

Conversation

@amoghrajesh
Copy link
Contributor


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

As seen in https://github.com/apache/airflow/actions/runs/23577516559/job/68654632264?pr=64239

There were some issues here.

  1. container_name (typed as str | None) passed to parameter expecting str
    since_seconds (typed as int | None) passed to parameter expecting int
    Fix is to use conditional parameter passing - only include optional parameters when they have non-None values:

  2. resource_version (typed as str | None) passed to parameter expecting str
    Conditional expression "NotOlderThan" if resource_version else None evaluated to str | None but expected str
    Fix is to only include both resource_version and resource_version_match when resource_version is not None


  • 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.

@amoghrajesh amoghrajesh requested a review from shahar1 as a code owner March 26, 2026 08:23
@eladkal eladkal merged commit fba15d6 into apache:main Mar 26, 2026
210 of 211 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants