From 72e4525f52e0eae2ae61de0a0a17bc636d96ea5b Mon Sep 17 00:00:00 2001 From: Matt Green Date: Mon, 9 Dec 2024 15:00:01 -0800 Subject: [PATCH] fix: index out of range error in feast integration --- .../python/denormalized/feast_data_stream.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/py-denormalized/python/denormalized/feast_data_stream.py b/py-denormalized/python/denormalized/feast_data_stream.py index 395f63f..728d376 100644 --- a/py-denormalized/python/denormalized/feast_data_stream.py +++ b/py-denormalized/python/denormalized/feast_data_stream.py @@ -108,10 +108,11 @@ def write_feast_feature( """ def _sink_to_feast(rb: pa.RecordBatch): - df = rb.to_pandas() - try: - feature_store.push(source_name, df, to=PushMode.ONLINE) - except Exception as e: - print(e) + if len(rb): + df = rb.to_pandas() + try: + feature_store.push(source_name, df, to=PushMode.ONLINE) + except Exception as e: + print(e) self.ds.sink_python(_sink_to_feast)