Skip to content

Commit 962ca9c

Browse files
committed
fix: Return local historical retrieval rows in entity_df order
A backend's left join does not have to keep the order of the left frame, so sort the joined rows by the entity row id. Signed-off-by: Edson <zhuoxi2000@gmail.com>
1 parent 0e1c766 commit 962ca9c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • sdk/python/feast/infra/compute_engines/local

‎sdk/python/feast/infra/compute_engines/local/nodes.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,10 @@ def execute(self, context: ExecutionContext) -> ArrowTableValue:
428428
on=[ENTITY_ROW_ID],
429429
how="left",
430430
)
431-
output = ArrowTableValue(self.backend.to_arrow(joined_df))
431+
# A backend's left join need not keep the left order; return the rows
432+
# in entity_df order.
433+
result = self.backend.to_arrow(joined_df).sort_by(ENTITY_ROW_ID)
434+
output = ArrowTableValue(result)
432435
context.node_outputs[self.name] = output
433436
return output
434437

0 commit comments

Comments
 (0)