From a410da3fffa48af72963db7aac038b692a975da7 Mon Sep 17 00:00:00 2001 From: TomSteenbergen Date: Mon, 6 May 2024 13:37:16 +0200 Subject: [PATCH] Fix from_expression when using Snowflake offline store Signed-off-by: TomSteenbergen --- sdk/python/feast/infra/offline_stores/snowflake.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/snowflake.py b/sdk/python/feast/infra/offline_stores/snowflake.py index 907e4d4483..cc59804467 100644 --- a/sdk/python/feast/infra/offline_stores/snowflake.py +++ b/sdk/python/feast/infra/offline_stores/snowflake.py @@ -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) + '"' @@ -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 = ( '"'