Skip to content

fix: deprecate max_items in favor of max_total_charge_usd - #1168

Merged
vdusek merged 9 commits into
masterfrom
deprecate-max-items
Oct 9, 2026
Merged

vdusek merged 9 commits into
masterfrom
deprecate-max-items

Conversation

@vdusek

@vdusek vdusek commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

max_items is a leftover from the pay-per-result pricing model. The platform applies it to pay-per-event Actors only when max_total_charge_usd is not set, by turning it into a charge limit priced by the Actor's apify-default-dataset-item event or its last pay-per-result price. On any other Actor it does nothing, and the name doesn't suggest that.

  • The max_items docstrings on Actor.start, Actor.call, Actor.start_task, Actor.call_task and Actor.resurrect mark it deprecated (removal in 5.0.0) and describe what it really does.
  • Passing max_items emits a FutureWarning that recommends max_total_charge_usd. I picked FutureWarning over DeprecationWarning because Python hides DeprecationWarning unless the caller is __main__, so it would never show up in an Actor's run log.

Stacked on #1167, which adds max_total_charge_usd to the task methods. Raised in #1166 (comment); the JS counterpart is apify/apify-sdk-js#768.

✍️ 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 Oct 8, 2026
@vdusek vdusek self-assigned this Oct 8, 2026
@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.84%. Comparing base (e3d36b9) to head (6f4a9ba).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1168      +/-   ##
==========================================
+ Coverage   92.82%   92.84%   +0.02%     
==========================================
  Files          53       53              
  Lines        3554     3566      +12     
==========================================
+ Hits         3299     3311      +12     
  Misses        255      255              
Flag Coverage Δ
e2e 32.72% <8.33%> (-0.09%) ⬇️
integration 53.11% <8.33%> (-0.16%) ⬇️
unit 89.48% <100.00%> (+0.03%) ⬆️

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 added this pull request to stack #1169 October 8, 2026 13:35
@vdusek vdusek changed the title feat: deprecate max_items in favor of max_total_charge_usd fix: deprecate max_items in favor of max_total_charge_usd Oct 8, 2026
@vdusek
vdusek requested review from Mantisus and barjin October 8, 2026 13:36
@vdusek
vdusek marked this pull request as ready for review October 8, 2026 13:38

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two wording nits, but otherwise lgtm. Thank you @vdusek !

Comment thread src/apify/_actor.py Outdated
Comment thread src/apify/_actor.py Outdated
Base automatically changed from chore/bump-apify-client-3.2.2b11 to master October 9, 2026 11:30
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 9, 2026
# Conflicts:
#	src/apify/_actor.py
#	tests/unit/actor/test_actor_helpers.py
@vdusek
vdusek merged commit c9991fa into master Oct 9, 2026
31 checks passed
@vdusek
vdusek deleted the deprecate-max-items branch October 9, 2026 11:38
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.

4 participants