Skip to content

fix: Make enqueue_links and export_to overloads consistent with their implementations - #2225

Merged
vdusek merged 2 commits into
masterfrom
fix/enqueue-links-export-to-overloads
Sep 10, 2026
Merged

vdusek merged 2 commits into
masterfrom
fix/enqueue-links-export-to-overloads

Conversation

@vdusek

@vdusek vdusek commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Bumps ty from 0.0.73 to 0.0.78 in the lock, and fixes the overloads that bump breaks.

Since ty 0.0.74, **kwargs: Unpack[TD] over an open TypedDict is read as also accepting any undeclared keyword as object. That extra catch-all makes an implementation which types such a keyword unassignable to an overload that leaves the keyword to **kwargs. On master, ty 0.0.78 reports 4 diagnostics: the EnqueueLinksFunction overloads, the assignability of the enqueue_links implementation to that protocol, and Dataset.export_to.

Each EnqueueLinksFunction overload now also names the keywords of the other mode, typed None. The implementation is assignable to both overloads again, and selector and requests become mutually exclusive for ty as well, which mypy and pyright already enforced.

Dataset.export_to no longer declares collect_all_keys on the implementation. It flows through **kwargs into the CSV exporter, the only one that takes it. Both overloads are unchanged.

The public API is untouched: same call signatures, no renamed or added types. One runtime edge case changes. export_to(key, 'json', collect_all_keys=True) used to ignore the flag and now raises TypeError from json.dump, which is how every other CSV-only keyword already behaved with JSON. mypy and pyright always rejected that call.

The source fix passes ty 0.0.73, 0.0.78 and 0.0.79, so it should survive the next few bumps. mypy and pyright each lose diagnostics and gain none. Once this lands, #2220 carries the rest of the lock refresh.

✍️ Drafted by Claude Code

… implementations

Since ty 0.0.74, `**kwargs: Unpack[TD]` with an open TypedDict also accepts
any undeclared keyword as `object`. An implementation that types such a
keyword is then not assignable to an overload that leaves it to `**kwargs`.
The `EnqueueLinksFunction` overloads now name the keywords of the other mode
typed `None`, which also makes `selector` and `requests` mutually exclusive
for ty. `Dataset.export_to` forwards `collect_all_keys` through `**kwargs`
instead of declaring it on the implementation, since only the CSV overload
declares it.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Sep 9, 2026
@vdusek vdusek self-assigned this Sep 9, 2026
@vdusek
vdusek requested a review from Pijukatel September 9, 2026 12:51
@github-actions github-actions Bot added this to the 149th sprint - Tooling team milestone Sep 9, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Sep 9, 2026
@vdusek vdusek mentioned this pull request Sep 9, 2026
1 task
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.75%. Comparing base (999f0c4) to head (ff8344b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2225   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files         181      181           
  Lines       12865    12865           
=======================================
  Hits        12061    12061           
  Misses        804      804           
Flag Coverage Δ
unit 93.75% <100.00%> (ø)

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

☔ View full report in Codecov by Harness.
📢 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 47e4630 into master Sep 10, 2026
36 checks passed
@vdusek
vdusek deleted the fix/enqueue-links-export-to-overloads branch September 10, 2026 06:11
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