Skip to content

Commit

Permalink
feat: Add authentication option for snowflake connector (feast-dev#3039)
Browse files Browse the repository at this point in the history
Signed-off-by: Lisa Aiken <[email protected]>

Signed-off-by: Lisa Aiken <[email protected]>
Signed-off-by: Francisco Javier Arceo <[email protected]>
  • Loading branch information
lsaiken authored and franciscojavierarceo committed Aug 13, 2022
1 parent 9aad1f2 commit 5aa3d00
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions sdk/python/feast/infra/offline_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class SnowflakeOfflineStoreConfig(FeastConfigBaseModel):
schema_: Optional[str] = Field(None, alias="schema")
""" Snowflake schema name """

authenticator: Optional[str] = None
""" Snowflake authenticator name """

storage_integration_name: Optional[str] = None
""" Storage integration name in snowflake """

Expand Down
6 changes: 5 additions & 1 deletion sdk/python/feast/infra/offline_stores/snowflake_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ class SavedDatasetSnowflakeStorage(SavedDatasetStorage):

def __init__(self, table_ref: str):
self.snowflake_options = SnowflakeOptions(
database=None, schema=None, table=table_ref, query=None, warehouse=None
database=None,
schema=None,
table=table_ref,
query=None,
warehouse=None,
)

@staticmethod
Expand Down
3 changes: 3 additions & 0 deletions sdk/python/feast/infra/online_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class SnowflakeOnlineStoreConfig(FeastConfigBaseModel):
schema_: Optional[str] = Field("PUBLIC", alias="schema")
""" Snowflake schema name """

authenticator: Optional[str] = None
""" Snowflake authenticator name """

class Config:
allow_population_by_field_name = True

Expand Down
4 changes: 3 additions & 1 deletion sdk/python/feast/infra/utils/snowflake_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def get_snowflake_conn(config, autocommit=True) -> SnowflakeConnection:

try:
conn = snowflake.connector.connect(
application="feast", autocommit=autocommit, **kwargs
application="feast",
autocommit=autocommit,
**kwargs,
)

return conn
Expand Down

0 comments on commit 5aa3d00

Please sign in to comment.