From 5b3406e816a00d166db9ca2fe71ca9665dd72fa8 Mon Sep 17 00:00:00 2001 From: Yam ZhengLim Date: Thu, 8 Dec 2022 00:22:59 +0800 Subject: [PATCH] Debug CRISP --- .../crisp_extract_function.cpython-39.pyc | Bin 2153 -> 2158 bytes crisp/extract/crisp_extract_function.py | 4 +++- main.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crisp/extract/__pycache__/crisp_extract_function.cpython-39.pyc b/crisp/extract/__pycache__/crisp_extract_function.cpython-39.pyc index c4976105cce03978d5658eb37c2e7e4d04778ee9..78ce7e1beec24e51323560deb56b7dffe23acbab 100644 GIT binary patch delta 486 zcmY+=y-Gtd6bJBga&wdW-6A-NBI=-E!NHFXItb$EQlU6VQIDuqwCznnCDB0~3*vo& z))x>Tz{SDYH*oIaGnihgXoizNNzU&;`o*tevKPkz*!A@Ka8Qa~k~+Ut(8V4YNoYJ` z#@9YMr%tP-vCg`V2JQEl2^8=jk!I#%s>oUbX_px5=%` z4cJ{aQSNxwiL4XnPCRgQq(c&`w=e|7FDROqw%yl)1WEEbjveuz3x-^hbIBj>N0Yyr zY`*83{HKMQlTQJKHHyfkxFZl$M2U9p7(x}!%N$hvfLF%|rhsrgp(0(l!~9jgS78Up z-rW?)tqjuwEZ9_mx#HG#AMHQ)S@z*R<4krh)=^|{VsmV~ad^=pg+^5;oSpfz367Z(w#kMN>@vB;hwqKI+4Iwx6aN%C&KK@EJd6Ilm^fl9*LS5+1X& z++fZg0|Q14n2iel7@BB+Ru_;9qfL0o2r1|@>(9^kh+Em4F^bp%Smjfg%XQdYv2meH ze1iy;7kMxCUQ&5U>6zGQ3YV{81dCr-^iDmaji8VO$$sEleY0&FS6n>e(uzy}a6el5 zt7W~HO3VIfiQ%LuBE3T~aZ36Ep-_~X;D#Y|;bf6Rk>2CQ5rVBDTu%6TYUMosRaWj@ z*aq@(RE_#<2_$8iDofKXsn!?7GHDY4 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)