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

Add warnings/errors for non-annotated fields #5263

Merged
merged 6 commits into from Mar 28, 2023
Merged

Add warnings/errors for non-annotated fields #5263

merged 6 commits into from Mar 28, 2023

Conversation

dmontagu
Copy link
Contributor

@dmontagu dmontagu commented Mar 23, 2023

I renamed keep_untouched to non_field_types as I feel this is more descriptive. (See the minor doc updates.)

Open to changing the logic here, and adding unit tests to ensure any scenarios we can think of are handled properly.

Selected Reviewer: @adriangb

@dmontagu
Copy link
Contributor Author

please review

@dmontagu dmontagu changed the title Add warning/errors for non-annotated fields Add warnings/errors for non-annotated fields Mar 28, 2023
pydantic/_internal/_model_construction.py Outdated Show resolved Hide resolved
pydantic/_internal/_model_construction.py Show resolved Hide resolved
tests/test_edge_cases.py Show resolved Hide resolved
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM.

pydantic/_internal/_model_construction.py Show resolved Hide resolved
pydantic/_internal/_model_construction.py Outdated Show resolved Hide resolved
pydantic/main.py Outdated Show resolved Hide resolved
pydantic/main.py Show resolved Hide resolved
tests/test_create_model.py Show resolved Hide resolved
tests/test_main.py Outdated Show resolved Hide resolved
@samuelcolvin
Copy link
Member

please update.

@dmontagu dmontagu enabled auto-merge (squash) March 28, 2023 16:57
@dmontagu dmontagu merged commit a968512 into main Mar 28, 2023
34 checks passed
@dmontagu dmontagu deleted the non-field-types branch March 28, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants