@@ -8,15 +8,14 @@ use test::{black_box, Bencher};
8
8
use pyo3:: prelude:: * ;
9
9
use pyo3:: types:: { PyDict , PyString } ;
10
10
11
- use _pydantic_core:: { validate_core_schema , SchemaValidator } ;
11
+ use _pydantic_core:: SchemaValidator ;
12
12
13
13
fn build_schema_validator_with_globals (
14
14
py : Python ,
15
15
code : & CStr ,
16
16
globals : Option < & Bound < ' _ , PyDict > > ,
17
17
) -> SchemaValidator {
18
- let mut schema = py. eval ( code, globals, None ) . unwrap ( ) . extract ( ) . unwrap ( ) ;
19
- schema = validate_core_schema ( & schema, None ) . unwrap ( ) . extract ( ) . unwrap ( ) ;
18
+ let schema = py. eval ( code, globals, None ) . unwrap ( ) . extract ( ) . unwrap ( ) ;
20
19
SchemaValidator :: py_new ( py, & schema, None ) . unwrap ( )
21
20
}
22
21
@@ -510,8 +509,7 @@ fn complete_model(bench: &mut Bencher) {
510
509
sys_path. call_method1 ( "append" , ( "./tests/benchmarks/" , ) ) . unwrap ( ) ;
511
510
512
511
let complete_schema = py. import ( "complete_schema" ) . unwrap ( ) ;
513
- let mut schema = complete_schema. call_method0 ( "schema" ) . unwrap ( ) ;
514
- schema = validate_core_schema ( & schema, None ) . unwrap ( ) . extract ( ) . unwrap ( ) ;
512
+ let schema = complete_schema. call_method0 ( "schema" ) . unwrap ( ) ;
515
513
let validator = SchemaValidator :: py_new ( py, & schema, None ) . unwrap ( ) ;
516
514
517
515
let input = complete_schema. call_method0 ( "input_data_lax" ) . unwrap ( ) ;
@@ -534,8 +532,7 @@ fn nested_model_using_definitions(bench: &mut Bencher) {
534
532
sys_path. call_method1 ( "append" , ( "./tests/benchmarks/" , ) ) . unwrap ( ) ;
535
533
536
534
let complete_schema = py. import ( "nested_schema" ) . unwrap ( ) ;
537
- let mut schema = complete_schema. call_method0 ( "schema_using_defs" ) . unwrap ( ) ;
538
- schema = validate_core_schema ( & schema, None ) . unwrap ( ) . extract ( ) . unwrap ( ) ;
535
+ let schema = complete_schema. call_method0 ( "schema_using_defs" ) . unwrap ( ) ;
539
536
let validator = SchemaValidator :: py_new ( py, & schema, None ) . unwrap ( ) ;
540
537
541
538
let input = complete_schema. call_method0 ( "input_data_valid" ) . unwrap ( ) ;
@@ -562,8 +559,7 @@ fn nested_model_inlined(bench: &mut Bencher) {
562
559
sys_path. call_method1 ( "append" , ( "./tests/benchmarks/" , ) ) . unwrap ( ) ;
563
560
564
561
let complete_schema = py. import ( "nested_schema" ) . unwrap ( ) ;
565
- let mut schema = complete_schema. call_method0 ( "inlined_schema" ) . unwrap ( ) ;
566
- schema = validate_core_schema ( & schema, None ) . unwrap ( ) . extract ( ) . unwrap ( ) ;
562
+ let schema = complete_schema. call_method0 ( "inlined_schema" ) . unwrap ( ) ;
567
563
let validator = SchemaValidator :: py_new ( py, & schema, None ) . unwrap ( ) ;
568
564
569
565
let input = complete_schema. call_method0 ( "input_data_valid" ) . unwrap ( ) ;
0 commit comments