Skip to content

Add pref_label/alt_label ilike_search to ETypeClass/MTypeClass filters#500

Merged
eleftherioszisis merged 2 commits intomainfrom
ilike_annotation
Jan 6, 2026
Merged

Add pref_label/alt_label ilike_search to ETypeClass/MTypeClass filters#500
eleftherioszisis merged 2 commits intomainfrom
ilike_annotation

Conversation

@eleftherioszisis
Copy link
Copy Markdown
Contributor

@eleftherioszisis eleftherioszisis commented Jan 6, 2026

Closes #499

Copy link
Copy Markdown
Contributor

@jdcourcol jdcourcol left a comment

Choose a reason for hiding this comment

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

Thank you for the prompt change !

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
pytest 97.60% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/filters/common.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/test_mtype.py
assert len(data) == 1

data = _req({"ilike_search": "alt_label_a*"})
assert len(data) == 2
Copy link
Copy Markdown
Collaborator

@GianlucaFicarelli GianlucaFicarelli Jan 6, 2026

Choose a reason for hiding this comment

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

Maybe not changed in this PR, but I see that the following request with ilike in nested filters, using * to match 0 or more characters doesn't return results:

curl -v 'http://127.0.0.1:8000/cell-morphology?mtype__pref_label__ilike=L23_*&page_size=2&page=1'

while this requests using % returns results:

curl -v 'http://127.0.0.1:8000/cell-morphology?mtype__pref_label__ilike=L23_%&page_size=2&page=1'

We should add a test also for nested fields, but if this needs a fix it can be done in a separate PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since my example above is for nested ilike and not nested ilike_search, do not consider it for this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is a valid point though that single column ilike behaves differently than the ilike_search. However, I was very hesitant introducing such a big breaking change given that all simple ilike queries will have to be converted to *word* to behave the same as they are behaving now.

@eleftherioszisis eleftherioszisis merged commit b8d97db into main Jan 6, 2026
2 checks passed
@eleftherioszisis eleftherioszisis deleted the ilike_annotation branch January 6, 2026 15:50
GianlucaFicarelli added a commit that referenced this pull request Jan 16, 2026
* origin/main:
  Update `brain-atlas` endpoints (#506)
  Add published_in filter in ScientificArtifact (#505)
  Make nullable attributes of EMDenseReconstructionDataset (#503)
  Remove all endpoints that had a `InBrainRegionDep`, but don't have a brain_region_id (#501)
  Add pref_label/alt_label ilike_search to ETypeClass/MTypeClass filters (#500)
  add `number_neurons` to Simulation` (#493)
  Fix incorrect returned values when getting `ascendants_and_descendants` (#498)
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.

Add pref_label & alt_label to ilike search fields for ETypeClass and MTypeClass

3 participants