Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make sure schema is used when generating from_expression for Snowflake #4177

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading