@@ -47,7 +47,7 @@ async def save(self, instance: MODEL) -> MODEL:
4747 :param instance: A mapped object instance to be persisted
4848 :return: The model instance after being persisted (e.g. with primary key populated)
4949 """
50- async with self ._get_session () as session : # type: ignore
50+ async with self ._get_session () as session :
5151 session .add (instance )
5252 return instance
5353
@@ -61,7 +61,7 @@ async def save_many(
6161 :type instances: Iterable
6262 :return: The model instances after being persisted (e.g. with primary keys populated)
6363 """
64- async with self ._get_session () as session : # type: ignore
64+ async with self ._get_session () as session :
6565 session .add_all (instances )
6666 return instances
6767
@@ -74,7 +74,7 @@ async def get(self, identifier: PRIMARY_KEY) -> MODEL:
7474 """
7575 # TODO: implement get_many()
7676 async with self ._get_session (commit = False ) as session :
77- model = await session .get (self ._model , identifier ) # type: ignore
77+ model = await session .get (self ._model , identifier )
7878 if model is None :
7979 raise ModelNotFound ("No rows found for provided primary key." )
8080 return model
@@ -90,7 +90,7 @@ async def delete(
9090 """
9191 # TODO: delete without loading the model
9292 obj = entity if self ._is_mapped_object (entity ) else await self .get (entity ) # type: ignore
93- async with self ._get_session () as session : # type: ignore
93+ async with self ._get_session () as session :
9494 await session .delete (obj )
9595
9696 async def find (
@@ -108,13 +108,13 @@ async def find(
108108 :return: A collection of models
109109 :rtype: List
110110 """
111- stmt = select (self ._model ) # type: ignore
111+ stmt = select (self ._model )
112112 if search_params :
113113 stmt = self ._filter_select (stmt , search_params )
114114
115115 if order_by is not None :
116116 stmt = self ._filter_order_by (stmt , order_by )
117117
118- async with self ._get_session () as session : # type: ignore
118+ async with self ._get_session () as session :
119119 result = await session .execute (stmt )
120120 return [x for x in result .scalars ()]
0 commit comments