Skip to content

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

Draft
Pijukatel wants to merge 2 commits into
masterfrom
claude/blissful-fermi-0acyp2
Draft

Pijukatel wants to merge 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 (32 errors): 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.

🤖 Generated with Claude Code

https://claude.ai/code/session_018m46SvjMFWEVxC4RDuegPN

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).

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants