General code clean up

This commit is contained in:
Scott Idem
2022-01-24 13:06:27 -05:00
parent b0537723a7
commit 86b06226cb
12 changed files with 55 additions and 55 deletions

View File

@@ -387,10 +387,10 @@ async def delete_obj(
def post_obj_template(
obj_type:str,
data:dict,
return_obj:bool=True,
by_alias:bool=True,
obj_type: str,
data: dict,
return_obj: bool=True,
by_alias: bool=True,
include: Optional[list] = [],
exclude: Optional[list] = [],
exclude_unset: Optional[bool] = True,
@@ -427,11 +427,11 @@ def post_obj_template(
def patch_obj_template(
obj_type:str,
data:dict,
obj_id:str,
return_obj:bool=True,
by_alias:bool=True,
obj_type: str,
data: dict,
obj_id: str,
return_obj: bool=True,
by_alias: bool=True,
include: Optional[list] = [],
exclude: Optional[list] = [],
exclude_unset: Optional[bool] = True,

View File

@@ -42,7 +42,7 @@ async def event_importing_create_update_w_external_id(
event_id = 1438 # CMSC 2021 1438 8nMUlA93Ybw
full_file_path = 'admin/temp/import_event_program_external_id.csv'
df = pandas.read_csv(full_file_path, na_filter=False, dtype={'external_id':str, 'External ID':str, 'event_presentation_external_id':str, 'event_presentation_code':str, 'event_presentation_sort':int, 'event_presenter_external_id':str, 'event_presenter_code':str, 'event_presenter_designations':str, 'event_presenter_sort':int, 'event_session_external_id':str, 'event_session_code':str, 'event_session_sort':int, 'source_id':str, 'Source ID':str, 'email':str, 'Email Address':str})
df = pandas.read_csv(full_file_path, na_filter=False, dtype={'external_id': str, 'External ID': str, 'event_presentation_external_id': str, 'event_presentation_code': str, 'event_presentation_sort': int, 'event_presenter_external_id': str, 'event_presenter_code': str, 'event_presenter_designations': str, 'event_presenter_sort': int, 'event_session_external_id': str, 'event_session_code': str, 'event_session_sort': int, 'source_id': str, 'Source ID': str, 'email': str, 'Email Address': str})
log.debug(df)
df_dict = df.to_dict(orient='records')

View File

@@ -86,7 +86,7 @@ async def importing_update_w_external_id(
log.info(f'Starting import for Account ID {account_id} File Name: {full_file_path}')
df = pandas.read_csv(full_file_path, na_filter=False, dtype={'external_id':str, 'External ID':str, 'source_id':str, 'Source ID':str, 'email':str, 'Email Address':str})
df = pandas.read_csv(full_file_path, na_filter=False, dtype={'external_id': str, 'External ID': str, 'source_id': str, 'Source ID': str, 'email': str, 'Email Address': str})
log.debug(df)
df_dict = df.to_dict(orient='records')
@@ -199,18 +199,18 @@ async def ins_up_person_contact_address_user_data(
df = pandas.read_csv(
full_file_path, na_filter=False,
dtype={'external_id':str,
'External ID':str,
'source_id':str,
'Source ID':str,
'email':str,
'Email Address':str,
'phone_home':str,
'phone_mobile':str,
'city':str,
'state_province':str,
'address_postal_code':str,
'country':str})
dtype={'external_id': str,
'External ID': str,
'source_id': str,
'Source ID': str,
'email': str,
'Email Address': str,
'phone_home': str,
'phone_mobile': str,
'city': str,
'state_province': str,
'address_postal_code': str,
'country': str})
#df = df.fillna('') # replace NaN with ''
# df = df.fillna(None)
# df = df.fillna('', inplace=True)
@@ -759,18 +759,18 @@ async def ins_up_membership_person_data(
df = pandas.read_csv(
full_file_path, na_filter=False,
dtype={'external_id':str,
'External ID':str,
'source_id':str,
'Source ID':str,
'email':str,
'Email Address':str,
'phone_home':str,
'phone_mobile':str,
'city':str,
'state_province':str,
'address_postal_code':str,
'country':str})
dtype={'external_id': str,
'External ID': str,
'source_id': str,
'Source ID': str,
'email': str,
'Email Address': str,
'phone_home': str,
'phone_mobile': str,
'city': str,
'state_province': str,
'address_postal_code': str,
'country': str})
df.rename(columns={
'Source ID': 'source_id',
@@ -1096,7 +1096,7 @@ async def importing_person_data(
account_id = 99
full_file_path = 'admin/temp/import_person_data.xlsx'
df = pandas.read_excel(full_file_path, na_filter=False, dtype={'external_import_id':str, 'phone_home':str, 'phone_mobile':str, 'city':str, 'state_province':str, 'address_postal_code':str, 'country':str})
df = pandas.read_excel(full_file_path, na_filter=False, dtype={'external_import_id': str, 'phone_home': str, 'phone_mobile': str, 'city': str, 'state_province': str, 'address_postal_code': str, 'country': str})
#df = df.fillna('') # replace NaN with ''
# df = df.fillna(None)
# df = df.fillna('', inplace=True)
@@ -1417,7 +1417,7 @@ async def importing_cont_edu_cert_person_data(
cont_edu_cert_id = 3
full_file_path = 'admin/temp/import_cont_edu_cert_person_data.xlsx'
df = pandas.read_excel(full_file_path, na_filter=False, dtype={'external_import_id':str, 'phone_home':str, 'phone_mobile':str, 'city':str, 'state_province':str, 'address_postal_code':str, 'country':str})
df = pandas.read_excel(full_file_path, na_filter=False, dtype={'external_import_id': str, 'phone_home': str, 'phone_mobile': str, 'city': str, 'state_province': str, 'address_postal_code': str, 'country': str})
log.debug(df)
df_dict = df.to_dict(orient='records')
@@ -1549,7 +1549,7 @@ async def importing_cont_edu_cert_person_data_touch(
cont_edu_cert_id = 3
full_file_path = 'admin/temp/import_cont_edu_cert_person_data.xlsx'
df = pandas.read_excel(full_file_path, na_filter=False, dtype={'external_import_id':str, 'phone_home':str, 'phone_mobile':str, 'city':str, 'state_province':str, 'address_postal_code':str, 'country':str})
df = pandas.read_excel(full_file_path, na_filter=False, dtype={'external_import_id': str, 'phone_home': str, 'phone_mobile': str, 'city': str, 'state_province': str, 'address_postal_code': str, 'country': str})
log.debug(df)
df_dict = df.to_dict(orient='records')