Skip to content

Commit

Permalink
Merge pull request #237 from ocefpaf/safer_use_special_var_name_only
Browse files Browse the repository at this point in the history
safer way to ensure the constraint is time
  • Loading branch information
ocefpaf authored Mar 15, 2022
2 parents 7efb039 + a61ed93 commit 7d0ede4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions erddapy/erddapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,16 @@ def get_download_url(
continue
# The valid operators are
# =, != (not equals), =~ (a regular expression test), <, <=, >, and >=
seps = ["=", "!=", "=~", "<", "<=", ">", ">="]
if k.startswith("time") and any([sep in k for sep in seps]):
valid_time_constraints = (
"time=",
"time!=",
"time=~",
"time<",
"time<=",
"time>",
"time>=",
)
if k.startswith(valid_time_constraints):
_constraints.update({k: parse_dates(v)})
_constraints = _quote_string_constraints(_constraints)
_constraints_url = _format_constraints_url(_constraints)
Expand Down

0 comments on commit 7d0ede4

Please sign in to comment.