Skip to content

Commit

Permalink
Add a warning when capitalized booleans appear in query
Browse files Browse the repository at this point in the history
The warning from signac.filterparse._cast is burried in the shell and
automatically searching for capitalized boolean string is likely not
the expected result.
  • Loading branch information
cbkerr committed Feb 14, 2024
1 parent 9b48fda commit bbfc4bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions signac_dashboard/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ def _job_search(self, query):
try:
f = json.loads(query)
except json.JSONDecodeError:
if "True" in query or "False" in query:
flash("JSON booleans are lowercase", "warning")

Check warning on line 377 in signac_dashboard/dashboard.py

View check run for this annotation

Codecov / codecov/patch

signac_dashboard/dashboard.py#L377

Added line #L377 was not covered by tests
query = shlex.split(query)
f = signac.filterparse.parse_filter_arg(query)
flash(f"Search string interpreted as '{json.dumps(f)}'.")
Expand Down

0 comments on commit bbfc4bc

Please sign in to comment.