Skip to content

fix: Do not mask unrelated import errors when guarding optional dependencies - #1009

Open
vdusek wants to merge 1 commit into
masterfrom
fix-try-import-masking
Open

fix: Do not mask unrelated import errors when guarding optional dependencies#1009
vdusek wants to merge 1 commit into
masterfrom
fix-try-import-masking

Conversation

@vdusek

@vdusek vdusek commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

try_import now swallows only the ModuleNotFoundError of the optional dependency it names, so an import error raised by the importing module itself or by another dependency propagates instead of being masked. __all__ of apify_client.http_compressors omits BrotliHttpCompressor when the brotli extra is not installed, since the symbol was never provided.

Split out of #1006.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Aug 17, 2026
@vdusek vdusek self-assigned this Aug 17, 2026
@github-actions github-actions Bot added this to the 147th sprint - Tooling team milestone Aug 17, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Aug 17, 2026
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.89%. Comparing base (31f7854) to head (e38c0b5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1009      +/-   ##
==========================================
+ Coverage   94.86%   94.89%   +0.02%     
==========================================
  Files          58       58              
  Lines        5357     5366       +9     
==========================================
+ Hits         5082     5092      +10     
+ Misses        275      274       -1     
Flag Coverage Δ
integration 92.30% <60.00%> (+0.16%) ⬆️
unit 84.66% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek requested a review from Pijukatel August 17, 2026 09:57
@vdusek
vdusek marked this pull request as ready for review August 17, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants