Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Use `ChoiceKey` in `TaggedUnionValidator` for int keys

#405Merged
Comparing
phil/choice-key
(
f743b90
) with
main
(
3ea00bd
)
CodSpeed Performance Gauge
+1%
Untouched
85

Benchmarks

85 total
test_core_future
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+5%
26.1 µs24.8 µs
test_positional_tuple
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+4%
23.9 µs22.9 µs
test_core_string_lax
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
11.5 µs11.2 µs
test_list_of_ints_core_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
1.1 ms1.1 ms
test_core_future
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+3%
17 µs16.5 µs
test_recursive_model_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
452.6 µs440.9 µs
test_core_raw
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+2%
11.7 µs11.4 µs
test_with_default
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
21.7 µs21.3 µs
test_core_python
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+2%
24.9 µs24.4 µs
test_core_string_strict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
11.5 µs11.3 µs
test_date_from_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+2%
15.1 µs14.8 µs
test_core_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+2%
17.6 µs17.3 µs
test_bytes_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
11.5 µs11.3 µs
test_date_from_date
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+2%
11.7 µs11.5 µs
test_small_class_core_dict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
18.1 µs17.8 µs
test_dont_raise_error
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
25.8 µs25.4 µs
test_core_future_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+1%
17.9 µs17.7 µs
test_to_string_direct
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
17.9 µs17.6 µs
test_isinstance_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
20.2 µs19.9 µs
test_list_of_any_core_py
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
16.5 µs16.3 µs
test_datetime
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
26.8 µs26.5 µs
test_small_class_core_model
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
27.2 µs26.9 µs
test_model_exclude_unset_true
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
34.9 µs34.5 µs
test_core_json_fs
tests/benchmarks/test_micro_benchmarks.py::TestModelLarge
CodSpeed Performance Gauge
+1%
187 µs184.9 µs
test_core_future_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+1%
15.4 µs15.2 µs

Commits

Click on a commit to change the comparison range
Base
main
3ea00bd
+0.84%
Mostly working ChoiceKey for int keys
7e5047d
3 years ago
by philhchen
-0.23%
address comments
104ab61
3 years ago
by philhchen
+0.04%
address more comments
8a16da7
3 years ago
by philhchen
-0.2%
add tests for int choice keys
1bbafa5
3 years ago
by philhchen
+0.28%
fix
2df01ed
3 years ago
by philhchen
-0.3%
add enum choices test
19f9466
3 years ago
by philhchen
+0.14%
update repeated tag test
e3f9e03
3 years ago
by philhchen
+0.03%
Set from_attributes to true by default for TaggedUnionValidator
67b74c0
3 years ago
by dmontagu
+0.18%
Get test passing
212af1f
3 years ago
by dmontagu
-0.23%
Get test passing
2bf1060
3 years ago
by dmontagu
+0.18%
fix tags_repr for ints
36c2cd3
3 years ago
by philhchen
+0.1%
refactor repeated tags test
063ac96
3 years ago
by philhchen
-0.04%
Use _extra.strict for literal validation of strs and ints
4c0c8d4
3 years ago
by philhchen
-0.35%
support i64 location keys, tests
2def74d
3 years ago
by samuelcolvin
+0.27%
change literal strict usage
f743b90
3 years ago
by samuelcolvin
© 2026 CodSpeed Technology
Home Terms Privacy Docs