Repository navigation
fix: add missing max_items to Actor.start, Actor.call and Actor.call_task - #1166
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1166 +/- ##
===========================================
+ Coverage 53.03% 92.92% +39.88%
===========================================
Files 53 53
Lines 3560 3560
===========================================
+ Hits 1888 3308 +1420
+ Misses 1672 252 -1420
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| max_items: Maximum number of dataset items you are charged for, for pay-per-result Actors. It caps the | ||
| charge, not the output, so the run can return fewer or more items than this. |
There was a problem hiding this comment.
Afaik this is a legacy-only option for the PPE Actors (that have been migrated from PPR, which is not a thing anymore).
iirc it only does something in case your Actor has the apify-default-dataset-item event. For other PPE / free Actors, this is no-op. This can imo be surprising, given the very human-friendly name (max_items), which might suggest otherwise.
run = Actor.start('a-ppe-actor', max_items=50) # returns 50 items, as it was PPR before
run = Actor.start('b-ppe-actor', max_items=50) # returns 1000 items, as it implements other eventsCan we be perhaps more vocal about this in the docstring (and propose max_total_charge_usd as the better / more modern option)?
Alternatively, we could drop it from the Python SDK altogether, if we haven't released yet 😅
There was a problem hiding this comment.
Actor.start(),Actor.call()andActor.call_task()now acceptmax_itemsand pass it to the API client. With it, a pay-per-result child run can be capped without going throughActor.apify_client, as the JS SDK already allows.Closes: #1163
✍️ Drafted by Claude Code