Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in SearchBuilder._initialize_additional_facets for array-of-primitive type #308

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ snovault
Change Log
----------

11.24.0
=======
* 2024-12-16/dmichaels
- Fix in search.SearchBuilder._initialize_additional_facets for array-of-primitive type;
e.g. came up in smaht-portal with additional_facet=sample_summary.studies.
- Updated dcicutils to 8.16.4.


11.23.0
=======
* 2024-11-02/dmichaels
Expand Down
89 changes: 47 additions & 42 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicsnovault"
version = "11.23.0"
version = "11.23.0.1b1" # TODO: To become 11.24.0
description = "Storage support for 4DN Data Portals."
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -46,7 +46,7 @@ elasticsearch = "7.13.4" # versions >= 7.14.0 lock out AWS ES
elasticsearch_dsl = "^7.4.0"
#python-3.12 elasticsearch = "^7.17.9"
#python-3.12 elasticsearch_dsl = "^7.4.1"
dcicutils = "^8.14.3"
dcicutils = "^8.16.4"
future = "^0.18.3"
html5lib = ">=1.1" # experimental, should be OK now that we're not using moto server
humanfriendly = "^1.44.9"
Expand Down
4 changes: 4 additions & 0 deletions snovault/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ def _initialize_additional_facets(self, facets_so_far, current_type_schema):
))
else:
t = field_definition.get('type', None)
# dmichaels/2024-12-16: Fix for arary-of-primitive;
# e.g. came up in smaht-portal with additional_facet=sample_summary.studies.
if t == "array":
t = field_definition.get("items", {}).get("type")
if not t:
log.error('Encountered an additional facet that has no type! %s' % field_definition)
continue # drop this facet
Expand Down
Loading