From 102281f08d953a97c73c439ac3ce497c07598102 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 28 Apr 2025 09:12:40 +0000 Subject: [PATCH] load to DB --- etl/db/load.py | 5 +++++ etl/hubspot_to_db.py | 13 ++++++++++++- etl/hubspot_to_invoice.py | 3 ++- etl/surveyPrice/surveyPrice.py | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 etl/db/load.py diff --git a/etl/db/load.py b/etl/db/load.py new file mode 100644 index 0000000..ec9145b --- /dev/null +++ b/etl/db/load.py @@ -0,0 +1,5 @@ + + +class loadToDb(): + def __init__(self): + pass \ No newline at end of file diff --git a/etl/hubspot_to_db.py b/etl/hubspot_to_db.py index 8cde782..867cc37 100644 --- a/etl/hubspot_to_db.py +++ b/etl/hubspot_to_db.py @@ -1 +1,12 @@ -print("hello world") +import os + + +os.environ["SHAREPOINT_CLIENT_ID"] = "895e3b77-b1d7-43ec-b18f-dcfe07cdfeaf" +os.environ["SHAREPOINT_CLIENT_SECRET"] = "SOf8Q~-is4wdQiqvEEm9FlJQRAY9ELGaj5Qz-a6E" +os.environ["SHAREPOINT_TENANT_ID"] = "c3f7519c-2719-4547-af04-6da6cbfd8f8f" +os.environ["SOUTH_COAST_INSULATION_SERVICE_SHAREPOINT_ID"] = "b5a51507-9427-4ee0-b03e-90ec7681e2d3" +os.environ["JJC_SERVICE_SHAREPOINT_ID"] = "7fdd0485-bbf3-4b29-b30f-98c81c2a6284" + +p + + diff --git a/etl/hubspot_to_invoice.py b/etl/hubspot_to_invoice.py index b13ac3c..c243fac 100644 --- a/etl/hubspot_to_invoice.py +++ b/etl/hubspot_to_invoice.py @@ -6,6 +6,7 @@ os.environ["SHAREPOINT_CLIENT_SECRET"] = "SOf8Q~-is4wdQiqvEEm9FlJQRAY9ELGaj5Qz-a os.environ["SHAREPOINT_TENANT_ID"] = "c3f7519c-2719-4547-af04-6da6cbfd8f8f" os.environ["SOUTH_COAST_INSULATION_SERVICE_SHAREPOINT_ID"] = "b5a51507-9427-4ee0-b03e-90ec7681e2d3" os.environ["JJC_SERVICE_SHAREPOINT_ID"] = "7fdd0485-bbf3-4b29-b30f-98c81c2a6284" +os.environ["DATABASE_URL"] = "postgresql://postgres:makingwarmhomes@db:5432/postgres" from etl.surveyPrice.surveyPrice import SurveyPrice @@ -32,7 +33,7 @@ sp.upload_to_sharepoint(sp.get_master_rate_card_path(), "COPY_OF_RATE_CARD_USED. deal_ids = df["HUBSPOT_DEAL_ID"].tolist() # Commented out as i don't want to sync up hubspot_to_db just yet -# sp.move_deals_to_completed(deal_ids) +sp.move_deals_to_completed(deal_ids) """ TODO: diff --git a/etl/surveyPrice/surveyPrice.py b/etl/surveyPrice/surveyPrice.py index f54da9b..db85108 100644 --- a/etl/surveyPrice/surveyPrice.py +++ b/etl/surveyPrice/surveyPrice.py @@ -164,7 +164,7 @@ class SurveyPrice(): scis_pd = self.sharepoint_data_for_installer(SharePointInstaller.SOUTH_COAST_INSULATION) self.all_survey_info_from_sharepoint = pd.concat([jjc_pd, scis_pd], ignore_index=True) return self.all_survey_info_from_sharepoint - + def sharepoint_data_for_installer(self, installer):