Skip to content

Commit

Permalink
fix serialization
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Adkins <[email protected]>
  • Loading branch information
sfc-gh-madkins committed Jul 28, 2022
1 parent 48ae284 commit 53aa4f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 7 additions & 4 deletions sdk/python/feast/infra/online_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ def online_write_batch(

for j, (feature_name, val) in enumerate(values.items()):
df.loc[j, "entity_feature_key"] = serialize_entity_key(
entity_key,
entity_key_serialization_version=2
entity_key, entity_key_serialization_version=2
) + bytes(feature_name, encoding="utf-8")
df.loc[j, "entity_key"] = serialize_entity_key(entity_key, entity_key_serialization_version=2)
df.loc[j, "entity_key"] = serialize_entity_key(
entity_key, entity_key_serialization_version=2
)
df.loc[j, "feature_name"] = feature_name
df.loc[j, "value"] = val.SerializeToString()
df.loc[j, "event_ts"] = timestamp
Expand Down Expand Up @@ -166,7 +167,9 @@ def online_read(
)

for entity_key in entity_keys:
entity_key_bin = serialize_entity_key(entity_key, entity_key_serialization_version=2)
entity_key_bin = serialize_entity_key(
entity_key, entity_key_serialization_version=2
)
res = {}
res_ts = None
for index, row in df[df["entity_key"] == entity_key_bin].iterrows():
Expand Down
1 change: 0 additions & 1 deletion sdk/python/feast/templates/snowflake/feature_store.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ offline_store:
role: SNOWFLAKE_ROLE
warehouse: SNOWFLAKE_WAREHOUSE
database: SNOWFLAKE_DATABASE
entity_key_serialization_version: 2
online_store:
type: snowflake.online
account: SNOWFLAKE_DEPLOYMENT_URL
Expand Down

0 comments on commit 53aa4f7

Please sign in to comment.