Skip to content

Commit b125ce0

Browse files
committed
fix retainDataByFacetValue issue (#3)
1 parent dc595a6 commit b125ce0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

xsearch/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import os
1313

1414
# version
15-
__version__ = "0.0.6"
15+
__version__ = "0.0.7"
1616

1717
# since this software is installed centrally and may be updated
1818
# this section of code stores the xsearch version in a hidden

xsearch/search.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ def retainDataByFacetValue(db, facet, value):
3737
values dict: dictionary with all items dropped, except
3838
those matching the facet-value pairing
3939
"""
40-
keyList = list(db.keys())
40+
db_copy = db.copy()
41+
keyList = list(db_copy.keys())
4142
for key in keyList:
42-
if db[key][facet] != value:
43-
db.pop(key)
44-
return db
43+
if db_copy[key][facet] != value:
44+
db_copy.pop(key)
45+
return db_copy
4546

4647

4748
def natural_sort(l):

0 commit comments

Comments
 (0)