Skip to content

Commit

Permalink
chore: Add tagging for snowflake engine (feast-dev#3147)
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Adkins <[email protected]>

Signed-off-by: Miles Adkins <[email protected]>
  • Loading branch information
sfc-gh-madkins authored Aug 29, 2022
1 parent 20a9dd9 commit 8fbf13c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sdk/python/feast/infra/utils/snowflake/snowpark/snowflake_udfs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from binascii import unhexlify

import pandas
Expand All @@ -24,6 +25,8 @@
# ValueType.BYTES = 1
@vectorized(input=pandas.DataFrame)
def feast_snowflake_binary_to_bytes_proto(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

df = list(
map(
ValueProto.SerializeToString,
Expand All @@ -45,6 +48,8 @@ def feast_snowflake_binary_to_bytes_proto(df):
# ValueType.STRING = 2
@vectorized(input=pandas.DataFrame)
def feast_snowflake_varchar_to_string_proto(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

df = list(
map(
ValueProto.SerializeToString,
Expand All @@ -66,6 +71,8 @@ def feast_snowflake_varchar_to_string_proto(df):
# ValueType.INT32 = 3
@vectorized(input=pandas.DataFrame)
def feast_snowflake_number_to_int32_proto(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

df = list(
map(
ValueProto.SerializeToString,
Expand All @@ -87,6 +94,8 @@ def feast_snowflake_number_to_int32_proto(df):
# ValueType.INT64 = 4
@vectorized(input=pandas.DataFrame)
def feast_snowflake_number_to_int64_proto(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

df = list(
map(
ValueProto.SerializeToString,
Expand All @@ -110,6 +119,8 @@ def feast_snowflake_number_to_int64_proto(df):
# ValueType.FLOAT = 5 & ValueType.DOUBLE = 6
@vectorized(input=pandas.DataFrame)
def feast_snowflake_float_to_double_proto(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

df = list(
map(
ValueProto.SerializeToString,
Expand All @@ -131,6 +142,8 @@ def feast_snowflake_float_to_double_proto(df):
# ValueType.BOOL = 7
@vectorized(input=pandas.DataFrame)
def feast_snowflake_boolean_to_bool_boolean_proto(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

df = list(
map(
ValueProto.SerializeToString,
Expand All @@ -152,6 +165,7 @@ def feast_snowflake_boolean_to_bool_boolean_proto(df):
# ValueType.UNIX_TIMESTAMP = 8
@vectorized(input=pandas.DataFrame)
def feast_snowflake_timestamp_to_unix_timestamp_proto(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

df = list(
map(
Expand All @@ -177,6 +191,8 @@ def feast_snowflake_timestamp_to_unix_timestamp_proto(df):
# converts 1 to n many entity keys to a single binary for lookups
@vectorized(input=pandas.DataFrame)
def feast_serialize_entity_keys(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

join_keys = create_entity_dict(df[0].values[0], df[2].values[0])

df = pandas.DataFrame.from_dict(
Expand Down Expand Up @@ -222,6 +238,8 @@ def feast_serialize_entity_keys(df):
# converts 1 to n many entity keys to a single binary for lookups
@vectorized(input=pandas.DataFrame)
def feast_entity_key_proto_to_string(df):
sys._xoptions["snowflake_partner_attribution"].append("feast")

join_keys = create_entity_dict(df[0].values[0], df[2].values[0])

df = pandas.DataFrame.from_dict(
Expand Down

0 comments on commit 8fbf13c

Please sign in to comment.