Avatar for the pydantic user
pydantic
pydantic
BlogDocsChangelog

Allow default factories of private attributes to take validated model data

#11685Closed
Comparing
andresliszt:add/validated-data-to-private-factory
(
0f435d3
) with
main
(
61a0673
)
CodSpeed Performance Gauge
0%
Untouched
212
Ignored
2

Benchmarks

214 total
test_north_star_json_loads
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
-4%
20.6 ms21.5 ms
test_complete_core_error
pydantic-core/tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
-4%
1.5 ms1.6 ms
test_set_of_ints_core_json_duplicates
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
-4%
422.6 µs440.4 µs
test_complete_core_isinstance
pydantic-core/tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
-4%
1.5 ms1.6 ms
test_north_star_validate_json
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
+4%
36 ms34.7 ms
test_list_of_strs_json_cached
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
313.1 µs304.2 µs
test_validators_build
tests/benchmarks/test_validators_build.py
CodSpeed Performance Gauge
+3%
1,011.6 µs983.3 µs
test_date_format
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
-3%
52.9 µs54.4 µs
test_raise_error_custom
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
41 µs40 µs
test_simple_model_validation[__init__]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
+3%
39.2 µs38.2 µs
test_set_of_ints_core_json
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
-2%
852.3 µs872.5 µs
test_model_validators_serializers
tests/benchmarks/test_model_schema_generation.py
CodSpeed Performance Gauge
-2%
811.7 µs830.4 µs
test_list_of_ints_core_json
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
760.9 µs744.1 µs
test_tagged_union_with_str_discriminator_schema_generation
tests/benchmarks/test_model_schema_generation.py
CodSpeed Performance Gauge
-2%
1.1 ms1.1 ms
test_simple_model_validation[model_validate]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
+2%
40.1 µs39.3 µs
test_date_format_function_no_info
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
-2%
53.1 µs54.1 µs
test_date_format_function
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
-2%
53.2 µs54.1 µs
test_dict_of_ints_core_json
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
1.4 ms1.3 ms
test_nested_model_validation[model_validate]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
-1%
48.6 µs49.2 µs
test_model_list_core_json
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
170 µs168 µs
test_list_of_nullable_core
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
-1%
104.8 µs105.9 µs
test_core_future
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+1%
15.9 µs15.8 µs
test_north_star_dump_python
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
+1%
17.5 ms17.3 ms
test_uuid_from_uuid_pyd
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
16.6 µs16.5 µs
test_dataclass_serialization_json
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
-1%
25.8 µs26.1 µs

Commits

Click on a commit to change the comparison range
Base
main
61a0673
-0.12%
Add default factory with validated data to PrivateAttr
0f435d3
1 year ago
by andresliszt
© 2026 CodSpeed Technology
Home Terms Privacy Docs