Skip to content

Commit 7a4edbd

Browse files
committed
test online response proto with redshift:dynamodb
Signed-off-by: Miguel Trejo <armando.trejo.marrufo@gmail.com>
1 parent 3f72228 commit 7a4edbd

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

sdk/python/feast/online_response.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@
2222

2323
TIMESTAMP_POSTFIX: str = "__ts"
2424

25+
import logging
26+
import sys
27+
28+
logger = logging.getLogger()
29+
logger.setLevel(logging.DEBUG)
30+
31+
handler = logging.StreamHandler(sys.stdout)
32+
handler.setLevel(logging.DEBUG)
33+
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
34+
handler.setFormatter(formatter)
35+
logger.addHandler(handler)
36+
2537

2638
class OnlineResponse:
2739
"""
@@ -57,7 +69,12 @@ def to_dict(self, include_event_timestamps: bool = False) -> Dict[str, Any]:
5769

5870
for result in self.proto.results:
5971
for idx, feature_ref in enumerate(self.proto.metadata.feature_names.val):
60-
native_type_value = feast_value_type_to_python_type(result.values[idx])
72+
try:
73+
native_type_value = feast_value_type_to_python_type(result.values[idx])
74+
except IndexError as e:
75+
logger.info(f'ERROR -- {e}')
76+
logger.info(f'ONLINE RESPONSE PROTO: {self.proto}')
77+
raise IndexError(e)
6178
if feature_ref not in response:
6279
response[feature_ref] = [native_type_value]
6380
else:

0 commit comments

Comments
 (0)