Skip to content

Use contextlib.suppress instead of try-except-pass and re-enable SIM105 (#66193)#66264

Merged
potiuk merged 1 commit into
apache:v3-2-testfrom
jscheffl:backport-251fe92-v3-2-test
May 2, 2026
Merged

Use contextlib.suppress instead of try-except-pass and re-enable SIM105 (#66193)#66264
potiuk merged 1 commit into
apache:v3-2-testfrom
jscheffl:backport-251fe92-v3-2-test

Conversation

@jscheffl
Copy link
Copy Markdown
Contributor

@jscheffl jscheffl commented May 2, 2026

Manual backport of #66193

(cherry picked from commit 251fe92)


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.
…05 (apache#66193)

Signed-off-by: ColtenOuO <jun930436@gmail.com>
(cherry picked from commit 251fe92)
@potiuk potiuk merged commit a016b7c into apache:v3-2-test May 2, 2026
195 of 196 checks passed
potiuk added a commit that referenced this pull request May 2, 2026
…viders (#66178) (#66280)

* Use contextlib.suppress instead of try-except-pass in providers (#66178)

Signed-off-by: ColtenOuO <jun930436@gmail.com>
(cherry picked from commit 9b9789a)

* Use contextlib.suppress for try-except-pass in spark_jdbc_script

`spark_jdbc_script.py` still has the `try-except-pass` pattern that
SIM105 flags. On `main` this file was rewritten in #64174 to raise an
explicit `AirflowOptionalProviderFeatureException` instead, but that
larger change is out of scope for v3-2-test. Apply the minimum
SIM105-compliant edit (`contextlib.suppress(ImportError)`) so the rule
re-enabled in #66264 stops failing on this file.

---------

Signed-off-by: ColtenOuO <jun930436@gmail.com>
Co-authored-by: Colten <70793703+ColtenOuO@users.noreply.github.com>
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 18, 2026
@vatsrahul1001 vatsrahul1001 added the type:misc/internal Changelog: Misc changes that should appear in change log label May 18, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…05 (#66193) (#66264)

(cherry picked from commit 251fe92)

Signed-off-by: ColtenOuO <jun930436@gmail.com>
Co-authored-by: Colten <70793703+ColtenOuO@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…viders (#66178) (#66280)

* Use contextlib.suppress instead of try-except-pass in providers (#66178)

Signed-off-by: ColtenOuO <jun930436@gmail.com>
(cherry picked from commit 9b9789a)

* Use contextlib.suppress for try-except-pass in spark_jdbc_script

`spark_jdbc_script.py` still has the `try-except-pass` pattern that
SIM105 flags. On `main` this file was rewritten in #64174 to raise an
explicit `AirflowOptionalProviderFeatureException` instead, but that
larger change is out of scope for v3-2-test. Apply the minimum
SIM105-compliant edit (`contextlib.suppress(ImportError)`) so the rule
re-enabled in #66264 stops failing on this file.

---------

Signed-off-by: ColtenOuO <jun930436@gmail.com>
Co-authored-by: Colten <70793703+ColtenOuO@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:CLI area:dev-tools area:task-sdk area:Triggerer type:misc/internal Changelog: Misc changes that should appear in change log

4 participants