Skip to content

Commit 4961aac

Browse files
authored
Fix solr get_many erroring for no ids (#11299)
* Fix solr get_many erroring for no ids
1 parent a30a8fb commit 4961aac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

openlibrary/utils/solr.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ def get_many(
6868
fields: Iterable[str] | None = None,
6969
doc_wrapper: Callable[[dict], T] = web.storage,
7070
) -> list[T]:
71-
if not keys:
71+
ids = list(keys)
72+
if not ids:
7273
return []
73-
logger.info(f"solr /get: {keys}, {fields}")
74+
logger.info(f"solr /get: {ids}, {fields}")
7475
resp = self.session.post(
7576
f"{self.base_url}/get",
7677
data={
77-
'ids': ','.join(keys),
78+
'ids': ','.join(ids),
7879
**({'fl': ','.join(fields)} if fields else {}),
7980
},
8081
).json()

0 commit comments

Comments
 (0)