Skip to content

Commit

Permalink
Update source.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aabbasi-hbo committed Nov 18, 2022
1 parent ec4012c commit 7c9827a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion feathr_project/feathr/definition/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ def __init__(self, name: str, database: str, schema: str, dbtable: Optional[str]
raise RuntimeError("One of dbtable or query must be specified..")
if dbtable is not None:
self.dbtable = dbtable
self.query = None
if query is not None:
self.query = query
self.dbtable = None
self.database = database
self.schema = schema
self.path = self._get_snowflake_path()
Expand All @@ -173,7 +175,7 @@ def _get_snowflake_path(self) -> str:
"""
Returns snowflake path for registry.
"""
if self.dbtable:
if self.dbtable is not None:
return f"snowflake://snowflake_account/?sfDatabase={self.database}&sfSchema={self.schema}&dbtable={self.dbtable}"
else:
return f"snowflake://snowflake_account/?sfDatabase={self.database}&sfSchema={self.schema}&query={self.query}"
Expand Down

0 comments on commit 7c9827a

Please sign in to comment.