You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor!: Mark secondary arguments as keyword-only (#917)
## Summary
Closes#881.
Reshapes function/method signatures across the SDK public API so that
secondary parameters must be passed as keyword arguments. Primary
"subject" arguments (e.g. `key`, `data`, `event_name`) stay positional.
Mirrors what was done in the client: apify/apify-client-python#766.
### Affected APIs
`Actor`:
- `get_value(key, *, default_value=None)`
- `push_data(data, *, charged_event_name=None)`
- `charge(event_name, *, count=1)`
- `use_state(default_value=None, *, key=None, kvs_name=None)`
`ChargingManager` / `ChargingManagerImplementation` (returned by
`Actor.get_charging_manager()`):
- `charge(event_name, *, count=1)`
Crawlee-overriding methods (e.g. `ProxyConfiguration.new_proxy_info`,
the storage clients) were intentionally left untouched — Crawlee's base
signatures are positional, so making the overrides keyword-only would
diverge from the base class.
## Why
Keyword-only parameters at API boundaries make call sites
self-documenting and prevent breakage when new options are added between
existing arguments.
**BREAKING CHANGE** for v4.0 — see
`docs/04_upgrading/upgrading_to_v4.md` for the migration guide.
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v4.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,24 @@ This guide lists the breaking changes between Apify Python SDK v3.x and v4.0.
10
10
11
11
Support for Python 3.10 has been dropped. The Apify Python SDK v4.x now requires Python 3.11 or later — make sure your environment is on a compatible version before upgrading.
12
12
13
+
## Keyword-only arguments
14
+
15
+
Secondary parameters in these signatures can no longer be passed positionally:
0 commit comments