Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a warning when capitalized booleans (improper JSON) appear in query #213

Merged
merged 8 commits into from
Mar 15, 2024

Conversation

cbkerr
Copy link
Member

@cbkerr cbkerr commented Feb 14, 2024

The warning from signac.filterparse._cast is burried in the shell and automatically searching for capitalized boolean string is likely not the expected result.

Description

Make the feedback when searching for booleans in incorrect JSON more like signac find:

$ signac find a True
Did you mean true?
Interpreted filter arguments as '{"a": "True"}'.
image

Motivation and Context

You would have to look at the shell to see these messages about casting of True-->true.

They come from signac.filterparse._cast

127.0.0.1 - - [14/Feb/2024 09:25:36] "POST /login HTTP/1.1" 302 -
Did you mean true?
Did you mean false?
Interpreted filter arguments as '{"a": "True"}'

Related to glotzerlab/signac-docs#199

Checklist:

The warning from signac.filterparse._cast is burried in the shell and
automatically searching for capitalized boolean string is likely not
the expected result.
@cbkerr cbkerr requested review from a team as code owners February 14, 2024 14:35
@cbkerr cbkerr requested review from bdice and klywang and removed request for a team February 14, 2024 14:35
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 69.55%. Comparing base (0a65622) to head (44ce715).
Report is 5 commits behind head on main.

❗ Current head 44ce715 differs from pull request most recent head 0be77c8. Consider uploading reports for the commit 0be77c8 to get more accurate results

Files Patch % Lines
signac_dashboard/dashboard.py 0.00% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #213      +/-   ##
==========================================
- Coverage   70.02%   69.55%   -0.48%     
==========================================
  Files          21       21              
  Lines         884      890       +6     
  Branches      159      162       +3     
==========================================
  Hits          619      619              
- Misses        220      223       +3     
- Partials       45       48       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cbkerr cbkerr requested a review from joaander February 15, 2024 18:31
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks fine after the suggested rephrasing of the message.

@cbkerr cbkerr requested a review from joaander February 28, 2024 17:09
signac_dashboard/dashboard.py Outdated Show resolved Hide resolved
@cbkerr cbkerr merged commit 21f2cca into main Mar 15, 2024
11 checks passed
@cbkerr cbkerr deleted the warning-on-capital-bool branch March 15, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants