Skip to content

Commit d8889f5

Browse files
committed
Remove class-based configuration
1 parent 9206e55 commit d8889f5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

sqlalchemy_bind_manager/_bind_manager.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Mapping, MutableMapping, Union
22

3-
from pydantic import BaseModel
3+
from pydantic import BaseModel, ConfigDict
44
from sqlalchemy import MetaData, create_engine
55
from sqlalchemy.engine import Engine
66
from sqlalchemy.ext.asyncio import (
@@ -36,8 +36,7 @@ class SQLAlchemyBind(BaseModel):
3636
registry_mapper: registry
3737
session_class: sessionmaker[Session]
3838

39-
class Config:
40-
arbitrary_types_allowed = True
39+
model_config = ConfigDict(arbitrary_types_allowed=True)
4140

4241

4342
class SQLAlchemyAsyncBind(BaseModel):
@@ -46,8 +45,7 @@ class SQLAlchemyAsyncBind(BaseModel):
4645
registry_mapper: registry
4746
session_class: async_sessionmaker[AsyncSession]
4847

49-
class Config:
50-
arbitrary_types_allowed = True
48+
model_config = ConfigDict(arbitrary_types_allowed=True)
5149

5250

5351
_SQLAlchemyConfig = Union[

0 commit comments

Comments
 (0)