Skip to content

Commit

Permalink
empty observation bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgitonga authored Sep 23, 2023
1 parent 7c76cab commit b72ab67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ecoscope/io/earthranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b72ab67

Please sign in to comment.