diff --git a/crisp/extract/__pycache__/crisp_extract_function.cpython-39.pyc b/crisp/extract/__pycache__/crisp_extract_function.cpython-39.pyc index c497610..78ce7e1 100644 Binary files a/crisp/extract/__pycache__/crisp_extract_function.cpython-39.pyc and b/crisp/extract/__pycache__/crisp_extract_function.cpython-39.pyc differ diff --git a/crisp/extract/crisp_extract_function.py b/crisp/extract/crisp_extract_function.py index 9c6fce4..1a3c5ec 100644 --- a/crisp/extract/crisp_extract_function.py +++ b/crisp/extract/crisp_extract_function.py @@ -30,6 +30,7 @@ def get_peoples_csv(website_id, client, path, filename): output_location = path + filename peoples_list_df = pd.DataFrame() peoples_data_df = pd.DataFrame() + people_subscription_status_df = pd.DataFrame() loop_flag = True page_number = 1 @@ -42,6 +43,7 @@ def get_peoples_csv(website_id, client, path, filename): else: page_number += 1 + # Get marking by CustomerService Operator for people_id in peoples_list_df.people_id: people_data_json = client.website.get_people_data(website_id, people_id) @@ -56,7 +58,7 @@ def get_peoples_csv(website_id, client, path, filename): people_subscription_status_json = client.website.get_people_subscription_status(website_id, people_id) temp_df = general_function.json_normalize_to_df(people_subscription_status_json) temp_df['people_id'] = people_id - people_subscription_status_df = pd.concat([temp_df,people_subscription_status_json], ignore_index=True) + people_subscription_status_df = pd.concat([temp_df,people_subscription_status_df], ignore_index=True) peoples_list_df = peoples_list_df.merge(people_subscription_status_df, on='people_id', how='left') diff --git a/main.py b/main.py index f88e785..c00bdec 100644 --- a/main.py +++ b/main.py @@ -143,7 +143,7 @@ def main(): #Make sure cron in the file directory general_function.change_to_current_directory() - # #Extract Load Exchange Data + #Extract Load Exchange Data CRISP_CSV_TEMP_STORAGE_PATH = "./crisp/extract/crisp_temp_extract_csv/" crisp_extract(CRISP_CSV_TEMP_STORAGE_PATH) crisp_load_to_cloudstorage(CRISP_CSV_TEMP_STORAGE_PATH)