PrefectHQ
prefect
BlogDocsChangelog

fix: prevent dictionary mutation during iteration in preprocess_schema

#19946Merged
Comparing
fix/preprocess-schema-dict-mutation
(
184c34b
) with
main
(
ae8ed34
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
602.5 µs600.6 µs
bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s

Ignored

bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-6%
31.7 ms33.5 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-31%
9.7 ms14.1 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1.1 s1.1 s
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-1%
107.2 ms108 ms
bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
166.4 ms166.7 ms
bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-9%
5.1 ms5.6 ms

Commits

Click on a commit to change the comparison range
Base
main
ae8ed34
+0.22%
fix: prevent dictionary mutation during iteration in preprocess_schema When processing schema definitions with block_type_slug where the definition's title differs from the dict key, the code would add a new key to the definitions dict while iterating over it, causing: RuntimeError: dictionary changed size during iteration This fix iterates over a snapshot of the dict values using list() to allow safe modification during iteration. Fixes #19935 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
184c34b
1 day ago
by zzstoatzz
© 2025 CodSpeed Technology
Home Terms Privacy Docs