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: Use dict[str, Any] for validated_data #49

Merged
merged 4 commits into from
Sep 14, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rest_framework-stubs/serializers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Serializer(BaseSerializer, metaclass=SerializerMetaclass):
def get_initial(self) -> Any: ...
fields: Any
def get_fields(self) -> dict[str, Field[Any, Any, Any, Any]]: ...
def validate(self, attrs: Any) -> Any: ...
def validate(self, attrs: dict[str, Any]) -> dict[str, Any]: ...
def __iter__(self) -> Iterator[str]: ...
def __getitem__(self, key: str) -> BoundField: ...
def _read_only_defaults(self) -> dict[str, Any]: ...
Expand Down Expand Up @@ -219,8 +219,8 @@ class ModelSerializer(Serializer, BaseSerializer):
allow_null: bool = ...,
allow_empty: bool = ...,
): ...
def update(self, instance: Any, validated_data: Any) -> Any: ...
def create(self, validated_data: Any) -> Any: ...
def update(self, instance: Any, validated_data: dict[str, Any]) -> Any: ...
def create(self, validated_data: dict[str, Any]) -> Any: ...
def save(self, **kwargs: Any) -> Any: ...
def to_representation(self, instance: Any) -> Any: ...
def get_field_names(
Expand Down
2 changes: 1 addition & 1 deletion rest_framework-stubs/test.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ForceAuthClientHandler(ClientHandler):
def __init__(self, *args: Any, **kwargs: Any): ...
def get_response(self, request: Request) -> Response: ... # type: ignore[override]

class APIClient(APIRequestFactory, DjangoClient):
class APIClient(APIRequestFactory, DjangoClient): # pyright: ignore[reportIncompatibleMethodOverride]
handler: Any = ...
def credentials(self, **kwargs: Any) -> Any: ...
def force_authenticate(self, user: Any | None = ..., token: Token | None = ...) -> None: ...
Expand Down
Loading