Skip to content

fix: make JsonSerializable type alias read-only - #1072

Merged
vdusek merged 2 commits into
masterfrom
claude/blissful-fermi-0acyp2
Sep 24, 2026
Merged

vdusek merged 2 commits into
masterfrom
claude/blissful-fermi-0acyp2

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Bumping ty to 0.0.83 fails type-check: it rejects e.g. list[dict[str, int]] as JsonSerializable because list/dict are invariant.

Fix: JsonSerializable uses read-only Mapping/Sequence, so callers can keep passing plain dicts and lists. The alias is only used for inputs that get serialized.

The lock bumps only ty to 0.0.83 so CI proves the fix; unit tests pass; also clears the push_items error in apify-sdk-python.

ty 0.0.83 rejects e.g. `list[dict[str, int]]` where `list[JsonSerializable]` is
expected, because `list`/`dict` are invariant. Using `Sequence`/`Mapping` makes
plain lists and dicts of JSON values acceptable again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018m46SvjMFWEVxC4RDuegPN
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.24%. Comparing base (77a3475) to head (c8126d2).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/apify_client/types.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1072      +/-   ##
==========================================
- Coverage   95.25%   95.24%   -0.02%     
==========================================
  Files          59       59              
  Lines        5547     5548       +1     
==========================================
  Hits         5284     5284              
- Misses        263      264       +1     
Flag Coverage Δ
integration 92.05% <0.00%> (+0.19%) ⬆️
unit 87.40% <0.00%> (-0.02%) ⬇️

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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018m46SvjMFWEVxC4RDuegPN
@Pijukatel
Pijukatel marked this pull request as ready for review September 24, 2026 07:00
@Pijukatel
Pijukatel requested a review from vdusek September 24, 2026 07:00
@apify-service-account apify-service-account added the t-tooling Issues with this label are in the ownership of the tooling team. label Sep 24, 2026
@vdusek
vdusek merged commit bd82a26 into master Sep 24, 2026
31 of 35 checks passed
@vdusek
vdusek deleted the claude/blissful-fermi-0acyp2 branch September 24, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants