Skip to content

Commit

Permalink
fix: Make sure schema is used when calling get_table_query_string m…
Browse files Browse the repository at this point in the history
…ethod for Snowflake datasource (#4131)

* Fix get_table_query_string method for Snowflake datasource

Signed-off-by: TomSteenbergen <tomsteenbergen1995@gmail.com>

* Add quotes to table string

Signed-off-by: TomSteenbergen <tomsteenbergen1995@gmail.com>

---------

Signed-off-by: TomSteenbergen <tomsteenbergen1995@gmail.com>
  • Loading branch information
TomSteenbergen authored Apr 25, 2024
1 parent 95acfb4 commit c1579c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdk/python/feast/infra/offline_stores/snowflake_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ def validate(self, config: RepoConfig):

def get_table_query_string(self) -> str:
"""Returns a string that can directly be used to reference this table in SQL."""
if self.database and self.table:
if self.database and self.schema and self.table:
return f'"{self.database}"."{self.schema}"."{self.table}"'
elif self.schema and self.table:
return f'"{self.schema}"."{self.table}"'
elif self.table:
return f'"{self.table}"'
else:
Expand Down

0 comments on commit c1579c7

Please sign in to comment.