Skip to content

Commit

Permalink
update to not and in predicates handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CecSve committed Feb 22, 2023
1 parent c10ff9e commit c57accc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygbif/occurrences/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def _parse_args(x):
if re.search(r"not|\!", x):
pred_type = "isNotNull"
return {"type": pred_type,"parameter": key}
if re.search(r"not|\!", x):
if re.search(r"\s+not|\!", x):
return {"type": "not","predicate": _parse_args(re.sub(r"not\s*|\!\s*", "", x))}
if re.match("geometry", x):
geometry = re.search("(POLY|MULTIPOLY).+", x, re.IGNORECASE).group()
return {"type": "within", "geometry": geometry}
if re.search(r"in", x):
if re.search(r"\s+in", x):
value_list = re.search(r"\[.*\]", x)
if not value_list:
raise Exception(
Expand Down

0 comments on commit c57accc

Please sign in to comment.