diff --git a/emission/analysis/intake/segmentation/trip_segmentation_methods/dwell_segmentation_time_filter.py b/emission/analysis/intake/segmentation/trip_segmentation_methods/dwell_segmentation_time_filter.py index 6fc047f4e..c2e3a5203 100644 --- a/emission/analysis/intake/segmentation/trip_segmentation_methods/dwell_segmentation_time_filter.py +++ b/emission/analysis/intake/segmentation/trip_segmentation_methods/dwell_segmentation_time_filter.py @@ -68,7 +68,7 @@ def segment_into_trips(self, timeseries, time_query): # Timer for fetching filtered location points with ect.Timer() as t_get_filtered_points_pre_ts_diff_df: filtered_points_pre_ts_diff_df = timeseries.get_data_df("background/filtered_location", time_query) - user_id = self.filtered_pointsdf.iloc[0]['user_id'] # Assuming user_id is available like this + user_id = self.filtered_pointsdf.iloc[0]['user_id'] if not self.filtered_points_df.empty else None esds.store_pipeline_time(user_id, ecwp.PipelineStages.TRIP_SEGMENTATION.name + "/segment_into_trips_time/get_filtered_location", time.time(), t_get_filtered_points_pre_ts_diff_df.elapsed) # Timer for filtering out bogus points