cognitedata / cognite-sdk-python

Cognite Python SDK
https://cognite-sdk-python.readthedocs-hosted.com/
Apache License 2.0
76 stars 27 forks source link

Better error message filter #1837

Closed doctrino closed 2 months ago

doctrino commented 2 months ago

Description

Some user struggled to understand this error message: image

Checklist:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.39%. Comparing base (2aa4995) to head (b80598e). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1837 +/- ## ========================================== - Coverage 92.46% 92.39% -0.08% ========================================== Files 124 124 Lines 18445 18452 +7 ========================================== - Hits 17056 17049 -7 - Misses 1389 1403 +14 ``` | [Files](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1837?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata) | Coverage Δ | | |---|---|---| | [cognite/client/data\_classes/filters.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1837?src=pr&el=tree&filepath=cognite%2Fclient%2Fdata_classes%2Ffilters.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata#diff-Y29nbml0ZS9jbGllbnQvZGF0YV9jbGFzc2VzL2ZpbHRlcnMucHk=) | `94.91% <50.00%> (-0.62%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1837/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata)
haakonvt commented 2 months ago

So they passed in a set when the type says Filter or dict? Hmm......

haakonvt commented 2 months ago

Had a look again at your screenshot. This won't fix the user issue as the validate is called before "merge-space-into-filter" (which you have modified)