Criteria in which either key or value are None#429
Criteria in which either key or value are None#429francescalb wants to merge 8 commits intomasterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #429 +/- ##
==========================================
- Coverage 83.48% 83.46% -0.02%
==========================================
Files 28 28
Lines 4008 4052 +44
==========================================
+ Hits 3346 3382 +36
- Misses 662 670 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tests/datadoc/test_dataset.py
Outdated
| assert set( | ||
| search( | ||
| ts, | ||
| criteria={"creator.name": ""}, |
There was a problem hiding this comment.
I think that the only None should be treated as a wildcard. The empty string should only match an empty string.
There was a problem hiding this comment.
I agree, corrected.
| def test_pipeline(): | ||
| """Test creating OTEAPI pipeline.""" | ||
| pytest.skip() | ||
| # pytest.skip() |
There was a problem hiding this comment.
Does this really works?
There was a problem hiding this comment.
Not really, there is an importorskip further down, and since otelib is not installed it never runs.
|
|
tripper/datadoc/dataset.py
Outdated
| criteria = criterias | ||
|
|
||
| if isinstance(criteria, list): | ||
| criteria.sort(key=lambda x: x[0]) |
There was a problem hiding this comment.
This will raise an error '<' not supported between instances of 'NoneType' and 'NoneType' for criteria with multiple empty (None) predicates. For example: [(None, 'TOX-252'), (None, 'TOX-254')]
There was a problem hiding this comment.
I think I corrected this.
|
Criteria with only the object specified returns no results. For example:
while
|
Strange, this seems to work in the tests. |
Description
closes #425
Type of change
Checklist for the reviewer
This checklist should be used as a help for the reviewer.