glotzerlab / signac

Manage large and heterogeneous data spaces on the file system.
https://signac.io/
BSD 3-Clause "New" or "Revised" License
130 stars 36 forks source link

Fix parsing of $not expression on command line #970

Closed cbkerr closed 8 months ago

cbkerr commented 8 months ago

Description

Motivation and Context

The $not expression was broken on the command line. I noticed this while working on https://github.com/glotzerlab/signac-docs/pull/199

signac was inserting sp. prefixes before the operator

$ signac find '{"$not": {"a": 1}}'
Error: "Invalid operator placement 'sp.$not.a'."

The function filterparse._add_prefix does the inserting, which later triggered an error in _search_indexer._find_expression. This code path wasn't tested.

Checklist:

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f9df893) 85.65% compared to head (b4b0cc2) 85.71%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #970 +/- ## ========================================== + Coverage 85.65% 85.71% +0.06% ========================================== Files 20 20 Lines 3464 3466 +2 Branches 759 760 +1 ========================================== + Hits 2967 2971 +4 + Misses 338 337 -1 + Partials 159 158 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.