PrefectHQ
prefect
BlogDocsChangelog

fix: handle pydantic generic models in JSON serializer

#19868Merged
Comparing
fix/json-serializer-pydantic-generics
(
139b051
) with
main
(
080230e
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s
bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
462 µs462.4 µs

Ignored

bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-3%
162.9 ms168.5 ms
bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+1%
34.1 ms33.7 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-18%
8.4 ms10.2 ms
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
107.2 ms107.5 ms
bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
5.5 ms5.5 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1.1 s1.1 s

Commits

Click on a commit to change the comparison range
Base
main
080230e
+0.01%
fix: handle pydantic generic models in JSON serializer When using parameterized Pydantic generic models like `APIResult[str]`, the JSON serializer was storing class names with brackets (e.g., `module.APIResult[str]`) which cannot be imported by Python's import system, causing deserialization to fail. This fix extracts the origin class from Pydantic's generic metadata, ensuring the serialized class name is importable (e.g., `module.APIResult`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
7a91c0c
2 days ago
by zzstoatzz
0%
test: add coverage for non-Pydantic generic dataclass serialization Ensures the Pydantic generic fix doesn't break standard Generic dataclasses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
139b051
2 days ago
by zzstoatzz
© 2025 CodSpeed Technology
Home Terms Privacy Docs