From fa83e79738e4098dbd90ec2e9307fb385579c81a Mon Sep 17 00:00:00 2001 From: sydney-runkle Date: Fri, 11 Oct 2024 17:09:59 -0400 Subject: [PATCH] remove invalid schema from core schema union --- python/pydantic_core/core_schema.py | 2 -- tests/test_schema_functions.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/python/pydantic_core/core_schema.py b/python/pydantic_core/core_schema.py index cd1525b6a..8872b8480 100644 --- a/python/pydantic_core/core_schema.py +++ b/python/pydantic_core/core_schema.py @@ -3846,7 +3846,6 @@ def definition_reference_schema( # union which kills performance not just for pydantic, but even for code using pydantic if not MYPY: CoreSchema = Union[ - InvalidSchema, AnySchema, NoneSchema, BoolSchema, @@ -3903,7 +3902,6 @@ def definition_reference_schema( # to update this, call `pytest -k test_core_schema_type_literal` and copy the output CoreSchemaType = Literal[ - 'invalid', 'any', 'none', 'bool', diff --git a/tests/test_schema_functions.py b/tests/test_schema_functions.py index a15adfca5..171e87d0b 100644 --- a/tests/test_schema_functions.py +++ b/tests/test_schema_functions.py @@ -323,6 +323,7 @@ def test_all_schema_functions_used(): # isn't a CoreSchema type types_used.remove('typed-dict-field') types_used.remove('model-field') + types_used.remove('invalid') assert all_types == types_used