Skip to content

Commit fa378ff

Browse files
authored
Merge pull request #2844 from dandi/fix-standard-search-operator
Remove `standard:` search operator
2 parents 97cb450 + 05fda3c commit fa378ff

5 files changed

Lines changed: 3 additions & 21 deletions

File tree

dandiapi/api/services/search/filters.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
'published_after',
3939
}
4040
)
41-
_ASSET_OPS = frozenset({'species', 'approach', 'technique', 'standard', 'file_type'})
41+
_ASSET_OPS = frozenset({'species', 'approach', 'technique', 'file_type'})
4242

4343

4444
def _annotate_latest_version_modified(queryset):
@@ -68,7 +68,6 @@ def _annotate_latest_published_created(queryset):
6868
'species': '$.wasAttributedTo[*].species.name',
6969
'approach': '$.approach[*].name',
7070
'technique': '$.measurementTechnique[*].name',
71-
'standard': '$.dataStandard[*].name',
7271
}
7372

7473

@@ -178,7 +177,7 @@ def apply_search_filters(
178177
if asset_qs is not None:
179178
# NOTE perf: jsonb_path_exists with a runtime-built jsonpath cannot
180179
# use the existing per-field GIN indexes; the path-scan operators
181-
# (species/approach/technique/standard) currently sequential-scan the
180+
# (species/approach/technique) currently sequential-scan the
182181
# asset_search materialized view. The view is small enough today
183182
# (~one row per asset) that this is acceptable, but if it becomes a
184183
# hot path the fix is expression GIN indexes on each path or

dandiapi/api/services/search/parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
'species',
3030
'approach',
3131
'technique',
32-
'standard',
3332
'file_type',
3433
}
3534
)

dandiapi/api/tests/test_dandiset.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,21 +1969,6 @@ def test_advanced_search_technique_with_quoted_phrase(api_client):
19691969
assert _search_ids(api_client, 'technique:surgical') == {surg.identifier}
19701970

19711971

1972-
@pytest.mark.ai_generated
1973-
@pytest.mark.django_db
1974-
def test_advanced_search_standard_matches(api_client):
1975-
nwb = _seed_dandiset_with_asset(
1976-
asset_metadata={'dataStandard': [{'name': 'Neurodata Without Borders (NWB)'}]},
1977-
)
1978-
bids = _seed_dandiset_with_asset(
1979-
asset_metadata={'dataStandard': [{'name': 'Brain Imaging Data Structure (BIDS)'}]},
1980-
)
1981-
_refresh_asset_search()
1982-
1983-
assert _search_ids(api_client, 'standard:NWB') == {nwb.identifier}
1984-
assert _search_ids(api_client, 'standard:BIDS') == {bids.identifier}
1985-
1986-
19871972
@pytest.mark.ai_generated
19881973
@pytest.mark.django_db
19891974
def test_advanced_search_file_type_alias_and_mime(api_client):

dandiapi/api/views/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class DandisetQueryParameterSerializer(serializers.Serializer):
309309
'Available operators: '
310310
'created_before, created_after, modified_before, modified_after, '
311311
'published_before, published_after (all take YYYY-MM-DD); '
312-
'species, approach, technique, standard (case-insensitive '
312+
'species, approach, technique (case-insensitive '
313313
'substring against the corresponding asset_metadata array); '
314314
'file_type (nwb, image, text, video — or any MIME prefix). '
315315
'Invalid syntax returns HTTP 400 with the offending token; '

web/src/components/DandisetSearchField.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ const operatorHelp = [
9393
{ example: 'species:mouse', description: 'Has assets attributed to a species' },
9494
{ example: 'approach:electrophysiology', description: 'Has assets using an approach' },
9595
{ example: 'technique:"patch clamp"', description: 'Has assets using a measurement technique' },
96-
{ example: 'standard:nwb', description: 'Has assets in a data standard' },
9796
{ example: 'file_type:nwb', description: 'Has assets of a file type (nwb, image, text, video)' },
9897
];
9998

0 commit comments

Comments
 (0)