Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in default factory error msg #6880

Merged
merged 1 commit into from Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pydantic/_internal/_std_types_schema.py
Expand Up @@ -639,7 +639,7 @@ def type_var_default_factory() -> None:
# a somewhat subjective set of types that have reasonable default values
allowed_msg = ', '.join([t.__name__ for t in set(allowed_default_types.values())])
raise PydanticSchemaGenerationError(
f'Unable to infer a default factory for with keys of type {values_source_type}.'
f'Unable to infer a default factory for keys of type {values_source_type}.'
f' Only {allowed_msg} are supported, other types require an explicit default factory'
' ' + instructions
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_types.py
Expand Up @@ -4967,7 +4967,7 @@ def test_defaultdict_unknown_default_factory() -> None:
"""
with pytest.raises(
PydanticSchemaGenerationError,
match=r'Unable to infer a default factory for with keys of type typing.DefaultDict\[int, int\]',
match=r'Unable to infer a default factory for keys of type typing.DefaultDict\[int, int\]',
):

class Model(BaseModel):
Expand Down