File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ def add_districtr_map_to_map_group(
344344 ).one_or_none ()
345345
346346 if existing_map_group :
347- session .commit ()
347+ session .rollback ()
348348 return
349349
350350 group_stmt = text ("""
Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ def load_sample_data(
268268 {"name" : view .gerrydb_table_name },
269269 ).scalar ()
270270 if gerrydb_table_exists :
271+ session .rollback ()
271272 logger .info (f"GerryDB table { view .gerrydb_table_name } already exists." )
272273 else :
273274 _create_shatterable_gerrydb_view (session = session , ** view .model_dump ())
@@ -282,6 +283,7 @@ def load_sample_data(
282283 {"slug" : view .districtr_map_slug },
283284 ).one_or_none ()
284285 if districtr_map_exists :
286+ session .rollback ()
285287 u = districtr_map_exists .uuid
286288 logger .info (f"Districtr map { view .districtr_map_slug } already exists." )
287289 else :
@@ -295,6 +297,7 @@ def load_sample_data(
295297 tiles_s3_path = view .tiles_s3_path ,
296298 num_districts = view .num_districts ,
297299 )
300+ session .commit ()
298301
299302 if u is not None :
300303 logger .info (f"Created districtr map with UUID { u } " )
You can’t perform that action at this time.
0 commit comments