We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45a4d15 commit 06f4551Copy full SHA for 06f4551
dspy/retrieve/databricks_rm.py
@@ -273,11 +273,12 @@ def forward(
273
274
# Extracting the results
275
items = []
276
- for _, data_row in enumerate(results["result"]["data_array"]):
277
- item = {}
278
- for col_name, val in zip(col_names, data_row):
279
- item[col_name] = val
280
- items += [item]
+ if "data_array" in results["result"]:
+ for _, data_row in enumerate(results["result"]["data_array"]):
+ item = {}
+ for col_name, val in zip(col_names, data_row):
+ item[col_name] = val
281
+ items += [item]
282
283
# Sorting results by score in descending order
284
sorted_docs = sorted(items, key=lambda x: x["score"], reverse=True)[: self.k]
0 commit comments