@@ -140,7 +140,7 @@ def save(self, installation: Installation):
140
140
141
141
i_column = self .installations .c
142
142
installations_rows = conn .execute (
143
- sqlalchemy .select ([ i_column .id ] )
143
+ sqlalchemy .select (i_column .id )
144
144
.where (
145
145
and_ (
146
146
i_column .client_id == self .client_id ,
@@ -152,7 +152,7 @@ def save(self, installation: Installation):
152
152
.limit (1 )
153
153
)
154
154
installations_row_id : Optional [str ] = None
155
- for row in installations_rows :
155
+ for row in installations_rows . mappings () :
156
156
installations_row_id = row ["id" ]
157
157
if installations_row_id is None :
158
158
conn .execute (self .installations .insert (), i )
@@ -171,7 +171,7 @@ def save_bot(self, bot: Bot):
171
171
172
172
b_column = self .bots .c
173
173
bots_rows = conn .execute (
174
- sqlalchemy .select ([ b_column .id ] )
174
+ sqlalchemy .select (b_column .id )
175
175
.where (
176
176
and_ (
177
177
b_column .client_id == self .client_id ,
@@ -183,7 +183,7 @@ def save_bot(self, bot: Bot):
183
183
.limit (1 )
184
184
)
185
185
bots_row_id : Optional [str ] = None
186
- for row in bots_rows :
186
+ for row in bots_rows . mappings () :
187
187
bots_row_id = row ["id" ]
188
188
if bots_row_id is None :
189
189
conn .execute (self .bots .insert (), b )
@@ -217,7 +217,7 @@ def find_bot(
217
217
218
218
with self .engine .connect () as conn :
219
219
result : object = conn .execute (query )
220
- for row in result : # type: ignore
220
+ for row in result . mappings () : # type: ignore
221
221
return Bot (
222
222
app_id = row ["app_id" ],
223
223
enterprise_id = row ["enterprise_id" ],
@@ -261,7 +261,7 @@ def find_installation(
261
261
installation : Optional [Installation ] = None
262
262
with self .engine .connect () as conn :
263
263
result : object = conn .execute (query )
264
- for row in result : # type: ignore
264
+ for row in result . mappings () : # type: ignore
265
265
installation = Installation (
266
266
app_id = row ["app_id" ],
267
267
enterprise_id = row ["enterprise_id" ],
@@ -302,7 +302,7 @@ def find_installation(
302
302
query = self .installations .select ().where (where_clause ).order_by (desc (c .installed_at )).limit (1 )
303
303
with self .engine .connect () as conn :
304
304
result : object = conn .execute (query )
305
- for row in result : # type: ignore
305
+ for row in result . mappings () : # type: ignore
306
306
installation .bot_token = row ["bot_token" ]
307
307
installation .bot_id = row ["bot_id" ]
308
308
installation .bot_user_id = row ["bot_user_id" ]
0 commit comments