diff --git a/etl/surveyPrice/surveyPrice.py b/etl/surveyPrice/surveyPrice.py index dd8c45e..6c46b07 100644 --- a/etl/surveyPrice/surveyPrice.py +++ b/etl/surveyPrice/surveyPrice.py @@ -152,6 +152,7 @@ class SurveyPrice(): if self.all_hubspot_submissions is None: raise RuntimeError("No information found from Hubspot") + # Standardise address self.all_survey_info_from_sharepoint['clean_address'] = self.all_survey_info_from_sharepoint['SHAREPOINT ADDRESS'].apply( lambda x: x.lower().replace(',', '').strip() ) @@ -160,11 +161,20 @@ class SurveyPrice(): lambda x: x.lower().replace(',', '').strip() ) + # re-name to installer + self.all_survey_info_from_sharepoint = self.all_survey_info_from_sharepoint.rename( + columns={'SHAREPOINT INSTALLER': 'INSTALLER'} + ) + + self.all_hubspot_submissions = self.all_hubspot_submissions.rename( + columns={'HUBSPOT_INSTALLER': 'INSTALLER'} + ) + merged_df = pd.merge( self.all_survey_info_from_sharepoint, self.all_hubspot_submissions, - left_on=['clean_address', 'SHAREPOINT INSTALLER'], - right_on=['clean_address', 'HUBSPOT_INSTALLER'], + left_on=['clean_address', 'INSTALLER'], + right_on=['clean_address', 'INSTALLER'], how='inner' )