General code clean up
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user