Skip to content

Commit

Permalink
fix: No Guid found in 233 entries for iNaturalist gbif csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieboldianus committed Aug 3, 2023
1 parent 76a5664 commit b9c427a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion resources/mappings/field_mapping_inaturalist_gbif.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,12 @@ def extract_gbif_occurrence(self, record):
@staticmethod
def strip_occurence_guid(occurrence_id: str) -> str:
"""Strip inaturalist prefix from occurrence guid"""
return occurrence_id.rsplit("/", 1)[-1]
if "/" in occurrence_id:
return occurrence_id.rsplit("/", 1)[-1]
# there are 233 entries in gbif data
# where the occurence_id from iNaturalist is
# not an URL; in this case, return unfiltered
return occurrence_id

def gbif_extract_postlatlng(self, lat_entry: str, lng_entry: str) -> str:
"""Basic routine for extracting lat/lng coordinates from post.
Expand Down

0 comments on commit b9c427a

Please sign in to comment.