Skip to content

refactor!: Mark secondary arguments as keyword-only#766

Merged
vdusek merged 1 commit intomasterfrom
refactor/keyword-only-arguments
Apr 28, 2026
Merged

refactor!: Mark secondary arguments as keyword-only#766
vdusek merged 1 commit intomasterfrom
refactor/keyword-only-arguments

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented Apr 28, 2026

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.

Secondary parameters (e.g. signature, content_type, count, idempotency_key,
method, expires_in) on KVS record methods, RunClient.charge, ApifyApiError,
and several internal helpers are now keyword-only. Primary subjects such as
key, value, event_name, and response stay positional. Improves call-site
readability and prevents argument-order mistakes when extending signatures.

BREAKING CHANGE: callers passing the affected arguments positionally must
switch to keyword form. See docs/04_upgrading/upgrading_to_v3.mdx for details.
@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 Apr 28, 2026
@vdusek vdusek self-assigned this Apr 28, 2026
@vdusek vdusek requested a review from Pijukatel April 28, 2026 08:08
@github-actions github-actions Bot added this to the 139th sprint - Tooling team milestone Apr 28, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Apr 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.05%. Comparing base (2f09830) to head (cb19bed).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
+ Coverage   95.68%   96.05%   +0.36%     
==========================================
  Files          48       48              
  Lines        5218     5218              
==========================================
+ Hits         4993     5012      +19     
+ Misses        225      206      -19     
Flag Coverage Δ
integration 96.05% <100.00%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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 merged commit 4ca99fd into master Apr 28, 2026
26 checks passed
@vdusek vdusek deleted the refactor/keyword-only-arguments branch April 28, 2026 13:57
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.

3 participants