Skip to content

fix: raise a helpful error for pre-v4 ActorEventTypes enum-member access#1050

Closed
vdusek wants to merge 1 commit into
masterfrom
worktree-fix-d6
Closed

fix: raise a helpful error for pre-v4 ActorEventTypes enum-member access#1050
vdusek wants to merge 1 commit into
masterfrom
worktree-fix-d6

Conversation

@vdusek

@vdusek vdusek commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

apify.ActorEventTypes became a bare Literal[...] alias in v4 (it was a StrEnum in v3). Since a typing.Literal object has no attributes, pre-v4 code doing ActorEventTypes.SYSTEM_INFO failed with a cryptic AttributeError: SYSTEM_INFO that gave no pointer to the migration.

This keeps the Literal[...] alias for type checkers and annotations, but at runtime binds ActorEventTypes to a shim whose __getattr__ raises a helpful AttributeError pointing at apify.Event.<NAME> and the v4 upgrade guide. Legitimate type-annotation use (e.g. event_type: ActorEventTypes) is unaffected.

@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 Jul 15, 2026
@vdusek vdusek self-assigned this Jul 15, 2026
@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 Jul 15, 2026
@github-actions github-actions Bot added this to the 145th sprint - Tooling team milestone Jul 15, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jul 15, 2026
@vdusek vdusek closed this Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.70%. Comparing base (ed1d8eb) to head (90aa47e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1050      +/-   ##
==========================================
- Coverage   91.75%   91.70%   -0.06%     
==========================================
  Files          50       50              
  Lines        3215     3219       +4     
==========================================
+ Hits         2950     2952       +2     
- Misses        265      267       +2     
Flag Coverage Δ
e2e ?
integration 57.34% <57.14%> (-0.05%) ⬇️
unit 83.03% <100.00%> (-0.05%) ⬇️

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.

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