Skip to content

Commit a16cd55

Browse files
authored
fix: Wrap LocalOutputNode return value in ArrowTableValue for consist… (#6286)
* fix: Wrap LocalOutputNode return value in ArrowTableValue for consistent DAG output Signed-off-by: cutoutsy <cutoutsy@gmail.com> * fix: Update test to access ArrowTableValue.data.num_rows instead of num_rows Signed-off-by: cutoutsy <cutoutsy@gmail.com> --------- Signed-off-by: cutoutsy <cutoutsy@gmail.com>
1 parent 863315e commit a16cd55

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,11 @@ def __init__(
361361

362362
def execute(self, context: ExecutionContext) -> ArrowTableValue:
363363
input_table = self.get_single_table(context).data
364-
context.node_outputs[self.name] = input_table
364+
output = ArrowTableValue(data=input_table)
365+
context.node_outputs[self.name] = output
365366

366367
if input_table.num_rows == 0:
367-
return input_table
368+
return output
368369

369370
if self.feature_view.online:
370371
online_store = context.online_store
@@ -403,4 +404,4 @@ def execute(self, context: ExecutionContext) -> ArrowTableValue:
403404
progress=lambda x: None,
404405
)
405406

406-
return input_table
407+
return output

sdk/python/tests/unit/infra/compute_engines/local/test_nodes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ def test_local_output_node():
216216
node.add_input(MagicMock())
217217
node.inputs[0].name = "source"
218218
result = node.execute(context)
219-
assert result.num_rows == 4
219+
assert isinstance(result, ArrowTableValue)
220+
assert result.data.num_rows == 4
220221

221222

222223
def test_local_output_node_online_write_default_batch():

0 commit comments

Comments
 (0)