Skip to content

Criteria in which either key or value are None#429

Open
francescalb wants to merge 8 commits intomasterfrom
flb/partially_defined_criteria
Open

Criteria in which either key or value are None#429
francescalb wants to merge 8 commits intomasterfrom
flb/partially_defined_criteria

Conversation

@francescalb
Copy link
Contributor

@francescalb francescalb commented Sep 16, 2025

Description

closes #425

Type of change

  • Bug fix and code cleanup
  • New feature
  • Documentation update
  • Testing

Checklist for the reviewer

This checklist should be used as a help for the reviewer.

  • Is the change limited to one issue?
  • Does this PR close the issue?
  • Is the code easy to read and understand?
  • Do all new feature have an accompanying new test?
  • Has the documentation been updated as necessary?
  • Is the code properly tested?

@codecov
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 81.63265% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.46%. Comparing base (82d015c) to head (3a1813c).

Files with missing lines Patch % Lines
tripper/datadoc/dataset.py 81.63% 9 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

assert set(
search(
ts,
criteria={"creator.name": ""},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the only None should be treated as a wildcard. The empty string should only match an empty string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, corrected.

def test_pipeline():
"""Test creating OTEAPI pipeline."""
pytest.skip()
# pytest.skip()
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this really works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, there is an importorskip further down, and since otelib is not installed it never runs.

@jesper-friis
Copy link
Contributor

criteria and regex should be treated the same way

criteria = criterias

if isinstance(criteria, list):
criteria.sort(key=lambda x: x[0])
Copy link
Collaborator

Choose a reason for hiding this comment

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

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')]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I corrected this.

@joahim
Copy link
Collaborator

joahim commented Sep 23, 2025

Criteria with only the object specified returns no results. For example:

[('http://pink-project.eu/carcinogenity#taid', 'TOX-252')] returns one result (http://pink-project.eu/carcinogenity#254)

while

[(None, 'TOX-252')] returns an empty list.

@francescalb
Copy link
Contributor Author

Criteria with only the object specified returns no results. For example:

[('http://pink-project.eu/carcinogenity#taid', 'TOX-252')] returns one result (http://pink-project.eu/carcinogenity#254)

while

[(None, 'TOX-252')] returns an empty list.

Strange, this seems to work in the tests.

@jesper-friis jesper-friis mentioned this pull request Sep 28, 2025
10 tasks
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.

Extended search functionality

3 participants