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 (#766)
## Summary
Reshapes function/method signatures across the public API so that
secondary parameters must be passed as keyword arguments. Primary
"subject" arguments (e.g. `key`, `value`, `event_name`, `response`) stay
positional.
Affected APIs:
- `KeyValueStoreClient.{get_record, get_record_as_bytes, stream_record,
set_record}` (sync + async) — `signature` / `content_type` are now
keyword-only.
- `RunClient.{charge, get_status_message_watcher}` (sync + async) —
`count`, `idempotency_key`, `to_logger`, `check_period`, `timeout` are
now keyword-only.
- `ApifyApiError(response, attempt, *, method='GET')` — `method` is now
keyword-only.
- Several internal helpers received the same treatment for consistency.
## Why
Keyword-only parameters at API boundaries make call sites
self-documenting and prevent breakage when new options are added between
existing arguments.
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v3.mdx
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -249,6 +249,44 @@ except NotFoundError:
249
249
250
250
Direct `.get()` also now swallows every 404 regardless of the `error.type` string in the response body (previously only `record-not-found` and `record-or-token-not-found` types were swallowed). If your code needs to distinguish between "resource missing" and "404 with an unexpected type", inspect `.type` on a caught <ApiLinkto="class/NotFoundError">`NotFoundError`</ApiLink> from a non-`.get()` call path.
251
251
252
+
## Keyword-only arguments for secondary parameters
253
+
254
+
Several methods and utility functions had additional `*` separators inserted into their signatures, so optional/secondary parameters can no longer be passed positionally. The "subject" arguments (e.g. `key` on KVS record methods, `event_name` on `charge()`) remain positional; only the parameters that follow them are affected.
## Snake_case `sort_by` values on `actors().list()`
253
291
254
292
The `sort_by` parameter of <ApiLinkto="class/ActorCollectionClient#list">`ActorCollectionClient.list()`</ApiLink> and <ApiLinkto="class/ActorCollectionClientAsync#list">`ActorCollectionClientAsync.list()`</ApiLink> now accepts pythonic snake_case values instead of the raw camelCase values used by the API.
0 commit comments