Add pref_label/alt_label ilike_search to ETypeClass/MTypeClass filters#500
Add pref_label/alt_label ilike_search to ETypeClass/MTypeClass filters#500eleftherioszisis merged 2 commits intomainfrom
Conversation
jdcourcol
left a comment
There was a problem hiding this comment.
Thank you for the prompt change !
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| assert len(data) == 1 | ||
|
|
||
| data = _req({"ilike_search": "alt_label_a*"}) | ||
| assert len(data) == 2 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Since my example above is for nested ilike and not nested ilike_search, do not consider it for this PR.
There was a problem hiding this comment.
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.
* 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)
Closes #499