77import typer
88from pydantic import EmailStr , NonNegativeInt
99from sqlalchemy import update
10- from sqlalchemy .cimmutabledict import immutabledict
1110from sqlalchemy .exc import IntegrityError
1211from sqlalchemy .ext .asyncio import AsyncSession
1312
@@ -96,7 +95,7 @@ async def update_subject_details(
9695
9796 query = query .values (** values )
9897 query = query .returning (SubjectSchema )
99- db_result = await session .execute (query , execution_options = immutabledict ( {"synchronize_session" : False }) )
98+ db_result = await session .execute (query , execution_options = {"synchronize_session" : False })
10099 mappings = db_result .mappings ().all ()
101100 updated_subject = SubjectSchema (** mappings [0 ])
102101
@@ -218,7 +217,7 @@ async def update_first_event_version(
218217 query = query .where (EventSchema .id == existing_event .id )
219218 query = query .values (** values )
220219 query = query .returning (EventSchema )
221- db_result = await session .execute (query , execution_options = immutabledict ( {"synchronize_session" : False }) )
220+ db_result = await session .execute (query , execution_options = {"synchronize_session" : False })
222221 mappings = db_result .mappings ().all ()
223222 updated_event = EventSchema (** mappings [0 ])
224223
@@ -235,7 +234,7 @@ async def update_first_event_version(
235234 "is_deleted" : is_deleted ,
236235 }
237236 history_query = history_query .values (** history_values )
238- await session .execute (history_query , execution_options = immutabledict ( {"synchronize_session" : False }) )
237+ await session .execute (history_query , execution_options = {"synchronize_session" : False })
239238
240239 # Update `applet_events` table
241240 applet_events_query = update (AppletEventsSchema )
@@ -246,7 +245,7 @@ async def update_first_event_version(
246245 created_at = new_event_created_at ,
247246 updated_at = new_event_created_at ,
248247 )
249- await session .execute (applet_events_query , execution_options = immutabledict ( {"synchronize_session" : False }) )
248+ await session .execute (applet_events_query , execution_options = {"synchronize_session" : False })
250249
251250
252251async def update_subsequent_event_version (
@@ -311,7 +310,7 @@ async def update_subsequent_event_version(
311310 query = query .where (EventSchema .id == existing_event .id )
312311 query = query .values (** values )
313312 query = query .returning (EventSchema )
314- db_result = await session .execute (query , execution_options = immutabledict ( {"synchronize_session" : False }) )
313+ db_result = await session .execute (query , execution_options = {"synchronize_session" : False })
315314 updated_event = EventSchema (** db_result .mappings ().all ()[0 ])
316315
317316 existing_id_version = f"{ existing_event .id } _{ updated_schedule .version } "
@@ -329,7 +328,7 @@ async def update_subsequent_event_version(
329328 "is_deleted" : event_data .is_deleted ,
330329 }
331330 history_query = history_query .values (** history_values )
332- await session .execute (history_query , execution_options = immutabledict ( {"synchronize_session" : False }) )
331+ await session .execute (history_query , execution_options = {"synchronize_session" : False })
333332
334333 # Update `applet_events` table
335334 applet_events_query = update (AppletEventsSchema )
@@ -340,7 +339,7 @@ async def update_subsequent_event_version(
340339 created_at = event_data .created_at ,
341340 updated_at = event_data .created_at ,
342341 )
343- await session .execute (applet_events_query , execution_options = immutabledict ( {"synchronize_session" : False }) )
342+ await session .execute (applet_events_query , execution_options = {"synchronize_session" : False })
344343
345344
346345async def find_schema_user (
@@ -384,7 +383,7 @@ async def create_schema_user(session: AsyncSession, user_config: UserConfig) ->
384383 }
385384
386385 update_query = update_query .values (** values )
387- await session .execute (update_query , execution_options = immutabledict ( {"synchronize_session" : False }) )
386+ await session .execute (update_query , execution_options = {"synchronize_session" : False })
388387
389388 return schema_user
390389
0 commit comments