@@ -140,7 +140,7 @@ def save(self, installation: Installation):
140140
141141 i_column = self .installations .c
142142 installations_rows = conn .execute (
143- sqlalchemy .select ([ i_column .id ] )
143+ sqlalchemy .select (i_column .id )
144144 .where (
145145 and_ (
146146 i_column .client_id == self .client_id ,
@@ -152,7 +152,7 @@ def save(self, installation: Installation):
152152 .limit (1 )
153153 )
154154 installations_row_id : Optional [str ] = None
155- for row in installations_rows :
155+ for row in installations_rows . mappings () :
156156 installations_row_id = row ["id" ]
157157 if installations_row_id is None :
158158 conn .execute (self .installations .insert (), i )
@@ -171,7 +171,7 @@ def save_bot(self, bot: Bot):
171171
172172 b_column = self .bots .c
173173 bots_rows = conn .execute (
174- sqlalchemy .select ([ b_column .id ] )
174+ sqlalchemy .select (b_column .id )
175175 .where (
176176 and_ (
177177 b_column .client_id == self .client_id ,
@@ -183,7 +183,7 @@ def save_bot(self, bot: Bot):
183183 .limit (1 )
184184 )
185185 bots_row_id : Optional [str ] = None
186- for row in bots_rows :
186+ for row in bots_rows . mappings () :
187187 bots_row_id = row ["id" ]
188188 if bots_row_id is None :
189189 conn .execute (self .bots .insert (), b )
@@ -217,7 +217,7 @@ def find_bot(
217217
218218 with self .engine .connect () as conn :
219219 result : object = conn .execute (query )
220- for row in result : # type: ignore
220+ for row in result . mappings () : # type: ignore
221221 return Bot (
222222 app_id = row ["app_id" ],
223223 enterprise_id = row ["enterprise_id" ],
@@ -261,7 +261,7 @@ def find_installation(
261261 installation : Optional [Installation ] = None
262262 with self .engine .connect () as conn :
263263 result : object = conn .execute (query )
264- for row in result : # type: ignore
264+ for row in result . mappings () : # type: ignore
265265 installation = Installation (
266266 app_id = row ["app_id" ],
267267 enterprise_id = row ["enterprise_id" ],
@@ -302,7 +302,7 @@ def find_installation(
302302 query = self .installations .select ().where (where_clause ).order_by (desc (c .installed_at )).limit (1 )
303303 with self .engine .connect () as conn :
304304 result : object = conn .execute (query )
305- for row in result : # type: ignore
305+ for row in result . mappings () : # type: ignore
306306 installation .bot_token = row ["bot_token" ]
307307 installation .bot_id = row ["bot_id" ]
308308 installation .bot_user_id = row ["bot_user_id" ]
0 commit comments