Skip to content

Commit cc08644

Browse files
updating test
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 77fa236 commit cc08644

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

sdk/python/tests/unit/test_on_demand_python_transformation.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,16 +629,31 @@ def python_stored_writes_feature_view(
629629

630630
def test_stored_writes(self):
631631
current_datetime = _utc_now()
632-
entity_rows_to_write = [
632+
fv_entity_rows_to_write = [
633+
{
634+
"driver_id": 1001,
635+
"conv_rate": 0.25,
636+
"acc_rate": 0.25,
637+
"avg_daily_trips": 2,
638+
"event_timestamp": current_datetime,
639+
"created": current_datetime,
640+
}
641+
]
642+
odfv_entity_rows_to_write = [
633643
{
634644
"driver_id": 1001,
635645
"counter": 0,
636646
"input_datetime": current_datetime,
637647
}
638648
]
649+
fv_entity_rows_to_read = [
650+
{
651+
"driver_id": 1001,
652+
}
653+
]
639654
# Note that here we shouldn't have to pass the request source features for reading
640655
# because they should have already been written to the online store
641-
entity_rows_to_read = [
656+
odfv_entity_rows_to_read = [
642657
{
643658
"driver_id": 1001,
644659
"conv_rate": 0.25,
@@ -647,14 +662,29 @@ def test_stored_writes(self):
647662
"input_datetime": current_datetime,
648663
}
649664
]
665+
print("storing fv features")
666+
self.store.write_to_online_store(
667+
feature_view_name="driver_hourly_stats",
668+
df=fv_entity_rows_to_write,
669+
)
670+
print("reading fv features")
671+
online_python_response = self.store.get_online_features(
672+
entity_rows=fv_entity_rows_to_read,
673+
features=[
674+
"driver_hourly_stats:conv_rate",
675+
"driver_hourly_stats:acc_rate",
676+
"driver_hourly_stats:avg_daily_trips",
677+
],
678+
).to_dict()
679+
print(online_python_response)
650680
print("storing odfv features")
651681
self.store.write_to_online_store(
652682
feature_view_name="python_stored_writes_feature_view",
653-
df=entity_rows_to_write,
683+
df=odfv_entity_rows_to_write,
654684
)
655685
print("reading odfv features")
656686
online_python_response = self.store.get_online_features(
657-
entity_rows=entity_rows_to_read,
687+
entity_rows=odfv_entity_rows_to_read,
658688
features=[
659689
"python_stored_writes_feature_view:conv_rate_plus_acc",
660690
"python_stored_writes_feature_view:current_datetime",

0 commit comments

Comments
 (0)