Skip to content

Commit

Permalink
remove invalid schema from core schema union
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-runkle committed Oct 11, 2024
1 parent 10374e2 commit fa83e79
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions python/pydantic_core/core_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions tests/test_schema_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fa83e79

Please sign in to comment.