Materials-Consortia / optimade-python-tools

Tools for implementing and consuming OPTIMADE APIs in Python
https://www.optimade.org/optimade-python-tools/
MIT License
71 stars 44 forks source link

Verify that missing values are not returned in comparisons #792

Closed ml-evs closed 3 years ago

ml-evs commented 3 years ago

(MongoDB's NOT will also return documents with missing values which is not allowed accoording the OPTMIADE standard. An alternative would be to add an extra expression to check wether a certain entry is present in a Document.

This is a good point that we may not be testing currently (I believe we only test "required" fields in our filter tests, which cannot be null/missing). As you say, a remedy may be to add an {"$exists": True} to every comparison we perform. I think I will raise another issue for this, as we should also test that the elasticsearch backend behaves appropriately.

Originally posted by @ml-evs and @JPBergsma in https://github.com/Materials-Consortia/optimade-python-tools/issues/79#issuecomment-834327481

ml-evs commented 3 years ago

I think I will quickly knock up a test for this.