diff --git a/ecoscope/io/earthranger.py b/ecoscope/io/earthranger.py index 9f5ae510..c9442580 100644 --- a/ecoscope/io/earthranger.py +++ b/ecoscope/io/earthranger.py @@ -733,14 +733,14 @@ def get_patrol_observations(self, patrols_df, include_patrol_details=False, **kw ] ) ) - observations.append(observation) + if len(observation) > 0: + observations.append(observation) except Exception as e: print( f"Getting observations for subject_id={subject_id} start_time={patrol_start_time}" f"end_time={patrol_end_time} failed for: {e}" ) - observations = [observation for observation in observations if len(observation) > 0] df = ecoscope.base.Relocations(pd.concat(observations)) if include_patrol_details: return df.set_index("id")