Skip to content

Commit 87d4573

Browse files
committed
chore: replace deprecated pydantic.parse_obj_as
parse_obj_as is deprecated, the deprecation warning is suggesting to use TypeAdapter.validate_python instead
1 parent e8a8fd4 commit 87d4573

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

onekey_client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from authlib.jose import jwt
1010
from authlib.oidc.core import IDToken
1111
from httpx import URL
12-
from pydantic import parse_obj_as
12+
from pydantic import TypeAdapter
1313

1414
from . import errors, keys
1515
from . import models as m
@@ -103,7 +103,7 @@ def login(self, email: str, password: str):
103103
claims_cls=IDToken,
104104
)
105105
tenants = id_token[TOKEN_NAMESPACE + "tenants"]
106-
tenants = parse_obj_as(list[m.Tenant], tenants)
106+
tenants = TypeAdapter(list[m.Tenant]).validate_python(tenants)
107107
self._state.tenants = {e.name: e for e in tenants}
108108
self._state.email = email
109109
self._state.raw_id_token = json_res["id_token"]

0 commit comments

Comments
 (0)