Prep for ISHLT

This commit is contained in:
Scott Idem
2023-04-10 18:54:42 -04:00
parent d7e1ad6010
commit 4c18d50c3b
5 changed files with 56 additions and 47 deletions

View File

@@ -1629,6 +1629,7 @@ async def importing_cont_edu_cert_person_data_touch(
# Updated 2022-04-06
@router.get('/bgh_program_import', response_model=Resp_Body_Base)
async def bgh_program_import(
event_id: str = Query(..., min_length=11, max_length=22),
begin_at: int = 0,
end_at: int = 100,
# response: Response = Response,
@@ -1638,10 +1639,14 @@ async def bgh_program_import(
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
account_id = commons.x_account_id # 4 GpLf_bnywCs
event_id = 1446
account_id = commons.x_account_id # GpLf_bnywCs (4)
full_file_path = 'admin/temp/import_bgh_2022-04_program_data.csv'
# BG 2023-04: zJP-Ld-A7-I4 (1447)
if event_id := redis_lookup_id_random(record_id_random=event_id, table_name='event'): pass
# elif event_exhibit_id is None: pass
else: return mk_resp(data=None, status_code=404, response=commons.response, status_message='The Event ID was invalid or not found.')
full_file_path = 'admin/temp/import_bgh_2023-04_program_data.csv'
df = pandas.read_csv(
full_file_path,
@@ -1649,7 +1654,7 @@ async def bgh_program_import(
dtype = {
'session_code': str,
'Session Code': str,
'session_title': str,
'session_title': str, # NOTE: "title", not "name"
'session_description': str,
'session_start_datetime': str,
'session_end_datetime': str,
@@ -1694,11 +1699,13 @@ async def bgh_program_import(
session_dict['start_datetime'] = record.get('session_start_datetime')
session_dict['end_datetime'] = record.get('session_end_datetime')
location_name = record.get('location_name')
if location_name == 'Broadway 1': session_dict['event_location_id'] = 301
elif location_name == 'Broadway 2': session_dict['event_location_id'] = 302
elif location_name == 'Broadway 3': session_dict['event_location_id'] = 303
elif location_name == 'Grand Ballroom': session_dict['event_location_id'] = 304
elif location_name == 'Sobro': session_dict['event_location_id'] = 305
if location_name == 'Grand Ballroom': session_dict['event_location_id'] = 349
elif location_name == 'Justice': session_dict['event_location_id'] = 350
elif location_name == 'Russell Cannon Hart': session_dict['event_location_id'] = 351
elif location_name == 'Salon D': session_dict['event_location_id'] = 352
elif location_name == 'Salon EF': session_dict['event_location_id'] = 353
elif location_name == 'Salon F': session_dict['event_location_id'] = 354
elif location_name == 'Salon G': session_dict['event_location_id'] = 355
create_update_event_session_obj_v4_result = create_update_event_session_obj_v4(
event_session_dict_obj = session_dict,
@@ -1724,8 +1731,8 @@ async def aapor_program_import(
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
account_id = commons.x_account_id # 20 j5EBhRDqPuw
# AAPOR 2022: 1447 x2H2P2MYlXU
account_id = commons.x_account_id # j5EBhRDqPuw (20)
# AAPOR 2022: x2H2P2MYlXU (1447)
if event_id := redis_lookup_id_random(record_id_random=event_id, table_name='event'): pass
# elif event_exhibit_id is None: pass
@@ -2130,7 +2137,7 @@ async def cmsc_program_import(
session_data['start_datetime'] = record.get('session_start_datetime')
session_data['end_datetime'] = record.get('session_end_datetime')
location_name = record.get('location_name')
if location_name == 'Annapolis 1-4': session_data['event_location_id'] = 319
elif location_name == 'Potomac 1-3': session_data['event_location_id'] = 320
elif location_name == 'Potomac 4-6': session_data['event_location_id'] = 321