Skip to content

Commit 54e9f4d

Browse files
authored
fix: patch type issue in evolution parsing (#980)
fixes: #900
1 parent 8d658a1 commit 54e9f4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ragas/testset/evolutions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,13 @@ async def generate_datarow(
202202
if isinstance(relevant_contexts_result, dict)
203203
else None
204204
)
205-
if relevant_context_indices is None:
205+
206+
if relevant_context_indices is not None:
207+
relevant_context_indices = [
208+
idx for idx in relevant_context_indices if isinstance(idx, int)
209+
]
210+
211+
if relevant_context_indices is None or not relevant_context_indices:
206212
relevant_context = CurrentNodes(
207213
root_node=current_nodes.root_node, nodes=current_nodes.nodes
208214
)

0 commit comments

Comments
 (0)