pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/fastapi/sqlmodel/pull/1724.patch

cated and does nothing. It will be removed, use `exclude` instead" + def __dataclass_transform__( *, @@ -212,7 +216,10 @@ def Field( title: Optional[str] = None, description: Optional[str] = None, exclude: Union[bool, None] = None, - include: Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any] = None, + include: Annotated[ + Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any], + deprecated(INCLUDE_DEPRECATION_MSG), + ] = None, const: Optional[bool] = None, gt: Optional[float] = None, ge: Optional[float] = None, @@ -255,7 +262,10 @@ def Field( title: Optional[str] = None, description: Optional[str] = None, exclude: Union[bool, None] = None, - include: Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any] = None, + include: Annotated[ + Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any], + deprecated(INCLUDE_DEPRECATION_MSG), + ] = None, const: Optional[bool] = None, gt: Optional[float] = None, ge: Optional[float] = None, @@ -307,7 +317,10 @@ def Field( title: Optional[str] = None, description: Optional[str] = None, exclude: Union[bool, None] = None, - include: Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any] = None, + include: Annotated[ + Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any], + deprecated(INCLUDE_DEPRECATION_MSG), + ] = None, const: Optional[bool] = None, gt: Optional[float] = None, ge: Optional[float] = None, @@ -340,7 +353,10 @@ def Field( title: Optional[str] = None, description: Optional[str] = None, exclude: Union[bool, None] = None, - include: Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any] = None, + include: Annotated[ + Union[Set[Union[int, str]], Mapping[Union[int, str], Any], Any], + deprecated(INCLUDE_DEPRECATION_MSG), + ] = None, const: Optional[bool] = None, gt: Optional[float] = None, ge: Optional[float] = None, @@ -371,6 +387,10 @@ def Field( schema_extra: Optional[dict[str, Any]] = None, ) -> Any: current_schema_extra = schema_extra or {} + + if include is not None: + warnings.warn(INCLUDE_DEPRECATION_MSG, DeprecationWarning, stacklevel=2) + # Extract possible alias settings from schema_extra so we can control precedence schema_validation_alias = current_schema_extra.pop("validation_alias", None) schema_serialization_alias = current_schema_extra.pop("serialization_alias", None) diff --git a/tests/test_pydantic/test_field.py b/tests/test_pydantic/test_field.py index 68858cf719..ac5d57379b 100644 --- a/tests/test_pydantic/test_field.py +++ b/tests/test_pydantic/test_field.py @@ -67,3 +67,13 @@ class Model(SQLModel): assert "id" in dict_representation assert "name" in dict_representation assert "value" not in dict_representation + + +def test_include_is_deprecated(): + with pytest.warns( + DeprecationWarning, + match="`include` is deprecated and does nothing. It will be removed, use `exclude` instead", + ): + + class Model(SQLModel): + values: list[int] = Field(include=True) \ No newline at end of file From bd8e3b87fb051205af731566a41149341d1f1ded Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 3 Feb 2026 09:17:40 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_pydantic/test_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pydantic/test_field.py b/tests/test_pydantic/test_field.py index ac5d57379b..14dceb190b 100644 --- a/tests/test_pydantic/test_field.py +++ b/tests/test_pydantic/test_field.py @@ -76,4 +76,4 @@ def test_include_is_deprecated(): ): class Model(SQLModel): - values: list[int] = Field(include=True) \ No newline at end of file + values: list[int] = Field(include=True) pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy