diff --git a/etl/db/hubSpotLoad.py b/etl/db/hubSpotLoad.py index a954a8f..ed21b8a 100644 --- a/etl/db/hubSpotLoad.py +++ b/etl/db/hubSpotLoad.py @@ -83,8 +83,9 @@ class HubspotTodb(): for add, file_loc in data_loc.items(): self.data_in_sharepoint.append(surveyedDataProcessor(add, file_loc)) - def load_all(self): - self.gather_data_from_each_sharepoint() + def load_all(self, fast=False): + if fast is False: + self.gather_data_from_each_sharepoint() with get_db_session() as session: self.load_pre_site_note(session) session.commit() diff --git a/etl/hubspot_to_db.py b/etl/hubspot_to_db.py index f5b14ea..8516a17 100644 --- a/etl/hubspot_to_db.py +++ b/etl/hubspot_to_db.py @@ -10,4 +10,4 @@ from etl.db.hubSpotLoad import HubspotTodb dbLoader = HubspotTodb() -dbLoader.load_all() \ No newline at end of file +dbLoader.load_all() diff --git a/etl/surveyedData/surveryedData.py b/etl/surveyedData/surveryedData.py index 42b78f1..b245b1d 100644 --- a/etl/surveyedData/surveryedData.py +++ b/etl/surveyedData/surveryedData.py @@ -5,7 +5,7 @@ from etl.transform.preSiteNoteTypes import ( AssessorInfo, CompanyInfo, PreSiteNotesSummaryInfo, PreSiteNote, PropertyDescription, Dimension, HeatingType, Heating, HeatingSystemControls, - OtherDetails, + OtherDetails, WindTurbine ) import uuid @@ -99,6 +99,9 @@ class surveyedDataProcessor(): # Other details otherDetails = self.get_attribute_and_load(self.pre_site_note.property_description, "otherDetails", OtherDetails, db_session) + + # windTurbine + windTurbine = self.get_attribute_and_load(self.pre_site_note.property_description, "windTurbine", WindTurbine, db_session) diff --git a/etl/transform/preSiteNoteTypes.py b/etl/transform/preSiteNoteTypes.py index b2a2e8f..a375ad3 100644 --- a/etl/transform/preSiteNoteTypes.py +++ b/etl/transform/preSiteNoteTypes.py @@ -219,6 +219,12 @@ class PropertyDescription(BaseModel): showerAndBaths: Optional[ShowerAndBaths] flueGasHeatRecoverySystem: Optional[FlueGasHeatRecoverySystem] photovoltaicPanel: Optional[PhotovoltaicPanel] + + # windTuribe + wind_turbine_id: Optional[uuid.UUID] = Field( + default=None, + foreign_key="windturbine.id" + ) windTurbine: Optional[WindTurbine]