Skip to content

Commit a410da3

Browse files
Fix from_expression when using Snowflake offline store
Signed-off-by: TomSteenbergen <[email protected]>
1 parent adc2939 commit a410da3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sdk/python/feast/infra/offline_stores/snowflake.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ def pull_latest_from_table_or_query(
139139
assert isinstance(data_source, SnowflakeSource)
140140

141141
from_expression = data_source.get_table_query_string()
142-
if not data_source.database and data_source.table:
142+
if not data_source.database and not data_source.schema and data_source.table:
143143
from_expression = f'"{config.offline_store.database}"."{config.offline_store.schema_}".{from_expression}'
144+
if not data_source.database and data_source.schema and data_source.table:
145+
from_expression = f'"{config.offline_store.database}".{from_expression}'
144146

145147
if join_key_columns:
146148
partition_by_join_key_string = '"' + '", "'.join(join_key_columns) + '"'
@@ -226,8 +228,10 @@ def pull_all_from_table_or_query(
226228
assert isinstance(data_source, SnowflakeSource)
227229

228230
from_expression = data_source.get_table_query_string()
229-
if not data_source.database and data_source.table:
231+
if not data_source.database and not data_source.schema and data_source.table:
230232
from_expression = f'"{config.offline_store.database}"."{config.offline_store.schema_}".{from_expression}'
233+
if not data_source.database and data_source.schema and data_source.table:
234+
from_expression = f'"{config.offline_store.database}".{from_expression}'
231235

232236
field_string = (
233237
'"'

0 commit comments

Comments
 (0)