diff --git a/src/wmrc/config.py b/src/wmrc/config.py index 84ecf82..540e7d9 100644 --- a/src/wmrc/config.py +++ b/src/wmrc/config.py @@ -30,11 +30,13 @@ COUNTIES_ITEMID = "90431cac2f9f49f4bcf1505419583753" -FEATURE_LAYER_ITEMID = "4df06137fb0a45459e49107a5f47a326" #: Beta version -# FEATURE_LAYER_ITEMID = "056bbc52ff3240f6b69666750a61aeff" #: Live version +FACILITIES_LAYER_ITEMID = "4df06137fb0a45459e49107a5f47a326" #: Beta version +# FACILITIES_LAYER_ITEMID = "056bbc52ff3240f6b69666750a61aeff" #: Live version JOIN_COLUMN = "id_" COUNTY_LAYER_ITEMID = "ea80c3c34bb147fba462ea100179bf09" COUNTY_BOUNDARIES_ITEMID = "4d0671aac09347d3a03415632f19ddb3" #: Must include a feature with the name "Out of State" +MATERIALS_LAYER_ITEM_ID = "43c5fe6a798346b6955f549404348f56" + YEAR = 2023 diff --git a/src/wmrc/main.py b/src/wmrc/main.py index 0dd1350..c274196 100644 --- a/src/wmrc/main.py +++ b/src/wmrc/main.py @@ -150,8 +150,8 @@ def process(self): records = self._load_salesforce_data() facility_summary_df = self._facility_summaries(records).query("data_year == @config.YEAR") county_summary_df = self._county_summaries(records) #.query("data_year == @config.YEAR") - materials_recycled_df = self._materials_recycled(records) - materials_composted_df = self._materials_composted(records) + # materials_recycled_df = self._materials_recycled(records) + # materials_composted_df = self._materials_composted(records) #: Facilities on map facilities_load_count = self._update_facilities(gis, facility_summary_df) @@ -162,6 +162,7 @@ def process(self): #: Materials recycled on dashboard: #: Truncate and load live data with sf analyses + end = datetime.now() summary_message = MessageDetails() @@ -215,7 +216,7 @@ def _update_facilities(self, gis, facility_summary_df): ) #: Merge live data with sheet/sf data - live_facility_data = transform.FeatureServiceMerging.get_live_dataframe(gis, config.FEATURE_LAYER_ITEMID) + live_facility_data = transform.FeatureServiceMerging.get_live_dataframe(gis, config.FACILITIES_LAYER_ITEMID) updated_facility_data = live_facility_data.set_index("id_") updated_facility_data.update(google_and_sf_data.set_index("id_")) updated_facility_data.reset_index(inplace=True) @@ -242,7 +243,7 @@ def _update_facilities(self, gis, facility_summary_df): # updated_facility_data.drop(columns=["local_health_department", "uocc_email_address"], inplace=True) self.skid_logger.info("Truncating and loading...") - updater = load.FeatureServiceUpdater(gis, config.FEATURE_LAYER_ITEMID, self.tempdir_path) + updater = load.FeatureServiceUpdater(gis, config.FACILITIES_LAYER_ITEMID, self.tempdir_path) load_count = updater.truncate_and_load_features(updated_facility_data) return load_count