Skip to content

Commit 9132a35

Browse files
committed
fix: change None only field types to Literal[None]
This is to fix the error from Pydantic v2.12+ like the one below: ```python .nox/test/lib/python3.14/site-packages/supabase/__init__.py:1: in <module> from supabase_auth.errors import ( .nox/test/lib/python3.14/site-packages/supabase_auth/__init__.py:3: in <module> from ._async.gotrue_admin_api import AsyncGoTrueAdminAPI # type: ignore # noqa: F401 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .nox/test/lib/python3.14/site-packages/supabase_auth/_async/gotrue_admin_api.py:6: in <module> from ..helpers import ( .nox/test/lib/python3.14/site-packages/supabase_auth/helpers.py:27: in <module> from .types import ( .nox/test/lib/python3.14/site-packages/supabase_auth/types.py:104: in <module> class AuthOtpResponse(BaseModel): .nox/test/lib/python3.14/site-packages/pydantic/_internal/_model_construction.py:242: in __new__ set_model_fields(cls, config_wrapper=config_wrapper, ns_resolver=ns_resolver) .nox/test/lib/python3.14/site-packages/pydantic/_internal/_model_construction.py:566: in set_model_fields fields, class_vars = collect_model_fields(cls, config_wrapper, ns_resolver, typevars_map=typevars_map) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .nox/test/lib/python3.14/site-packages/pydantic/_internal/_fields.py:364: in collect_model_fields field_info = FieldInfo_.from_annotated_attribute(ann_type, assigned_value, _source=AnnotationSource.CLASS) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .nox/test/lib/python3.14/site-packages/pydantic/fields.py:382: in from_annotated_attribute raise PydanticUserError( E pydantic.errors.PydanticUserError: Error when building FieldInfo from annotated attribute. Make sure you don't have any field name clashing with a type annotation. E E For further information visit https://errors.pydantic.dev/2.12/u/unevaluable-type-annotation ```
1 parent d741716 commit 9132a35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/auth/src/supabase_auth/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ class AuthResponse(BaseModel):
102102

103103

104104
class AuthOtpResponse(BaseModel):
105-
user: None = None
106-
session: None = None
105+
user: Literal[None] = None
106+
session: Literal[None] = None
107107
message_id: Optional[str] = None
108108

109109

0 commit comments

Comments
 (0)