fix: forward missing run kwargs in Actor.start/call/call_task#906
fix: forward missing run kwargs in Actor.start/call/call_task#906vdusek wants to merge 1 commit into
Conversation
Align the SDK wrappers with `apify-client`: pass through `max_items`, `max_total_charge_usd`, `restart_on_error`, and `force_permission_level` so users no longer have to drop down to the raw client to set them.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #906 +/- ##
=======================================
Coverage 87.01% 87.01%
=======================================
Files 48 48
Lines 2942 2942
=======================================
Hits 2560 2560
Misses 382 382
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MatousMarik
left a comment
There was a problem hiding this comment.
Seems ok to me.
One concern though: this approach of manually mirroring kwargs from the
client is fragile — next time the client adds a parameter, someone has to
remember to update the SDK too. Would it be possible to extract the
"passthrough" subset into a shared TypedDict and use **kwargs:
Unpack[RunConfig]? That would make the boundary explicit and future-safe.
Also, was a full audit done against the current client signatures? This PR
fixes the reported case, but are we confident there are no other missing
args across start / call / call_task right now?
| token: str | None = None, | ||
| content_type: str | None = None, | ||
| build: str | None = None, | ||
| max_items: int | None = None, |
There was a problem hiding this comment.
PPR is effectively removed now. Maybe we don't need to add this parameter?
Summary
ActorClient.call(apify-client) exposes several run-configuration kwargs that the SDK wrapperActor.callwas silently dropping, forcing users to bypass the SDK and reach intoActor.apify_client.actor(id).call(...)(e.g. to setmax_total_charge_usdfor pay-per-event Actors — see the user report).This patch wires through the missing parameters so the SDK API matches the underlying client:
Actor.start/Actor.call— addsmax_items,max_total_charge_usd,restart_on_error,force_permission_levelActor.call_task— addsmax_items,restart_on_error(the task endpoint has nomax_total_charge_usd/force_permission_level)Docstrings updated to match. No change to existing kwargs or call semantics; pyproject
apify-clientconstraint unchanged.