Skip to content

Commit

Permalink
Fix from_expression when using Snowflake offline store
Browse files Browse the repository at this point in the history
Signed-off-by: TomSteenbergen <[email protected]>
  • Loading branch information
TomSteenbergen committed May 6, 2024
1 parent adc2939 commit a410da3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdk/python/feast/infra/offline_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ def pull_latest_from_table_or_query(
assert isinstance(data_source, SnowflakeSource)

from_expression = data_source.get_table_query_string()
if not data_source.database and data_source.table:
if not data_source.database and not data_source.schema and data_source.table:
from_expression = f'"{config.offline_store.database}"."{config.offline_store.schema_}".{from_expression}'
if not data_source.database and data_source.schema and data_source.table:
from_expression = f'"{config.offline_store.database}".{from_expression}'

if join_key_columns:
partition_by_join_key_string = '"' + '", "'.join(join_key_columns) + '"'
Expand Down Expand Up @@ -226,8 +228,10 @@ def pull_all_from_table_or_query(
assert isinstance(data_source, SnowflakeSource)

from_expression = data_source.get_table_query_string()
if not data_source.database and data_source.table:
if not data_source.database and not data_source.schema and data_source.table:
from_expression = f'"{config.offline_store.database}"."{config.offline_store.schema_}".{from_expression}'
if not data_source.database and data_source.schema and data_source.table:
from_expression = f'"{config.offline_store.database}".{from_expression}'

field_string = (
'"'
Expand Down

0 comments on commit a410da3

Please sign in to comment.