1+ import warnings
12from typing import Callable , Dict , Iterable , Optional , Tuple
23
34from typeguard import typechecked
@@ -45,7 +46,6 @@ def __init__(
4546 timestamp_field (optional): Event timestamp field used for point in time
4647 joins of feature values.
4748 database (optional): Snowflake database where the features are stored.
48- warehouse (optional): Snowflake warehouse where the database is stored.
4949 schema (optional): Snowflake schema in which the table is located.
5050 table (optional): Snowflake table where the features are stored. Exactly one of 'table'
5151 and 'query' must be specified.
@@ -60,6 +60,14 @@ def __init__(
6060 owner (optional): The owner of the snowflake source, typically the email of the primary
6161 maintainer.
6262 """
63+
64+ if warehouse :
65+ warnings .warn (
66+ "Specifying a warehouse within a SnowflakeSource is to be deprecated."
67+ "Starting v0.32.0, the warehouse as part of the Snowflake store config will be used." ,
68+ RuntimeWarning ,
69+ )
70+
6371 if table is None and query is None :
6472 raise ValueError ('No "table" or "query" argument provided.' )
6573 if table and query :
@@ -73,7 +81,6 @@ def __init__(
7381 schema = _schema ,
7482 table = table ,
7583 query = query ,
76- warehouse = warehouse ,
7784 )
7885
7986 # If no name, use the table as the default name.
@@ -109,7 +116,6 @@ def from_proto(data_source: DataSourceProto):
109116 database = data_source .snowflake_options .database ,
110117 schema = data_source .snowflake_options .schema ,
111118 table = data_source .snowflake_options .table ,
112- warehouse = data_source .snowflake_options .warehouse ,
113119 created_timestamp_column = data_source .created_timestamp_column ,
114120 field_mapping = dict (data_source .field_mapping ),
115121 query = data_source .snowflake_options .query ,
@@ -134,7 +140,6 @@ def __eq__(self, other):
134140 and self .schema == other .schema
135141 and self .table == other .table
136142 and self .query == other .query
137- and self .warehouse == other .warehouse
138143 )
139144
140145 @property
@@ -157,11 +162,6 @@ def query(self):
157162 """Returns the snowflake options of this snowflake source."""
158163 return self .snowflake_options .query
159164
160- @property
161- def warehouse (self ):
162- """Returns the warehouse of this snowflake source."""
163- return self .snowflake_options .warehouse
164-
165165 def to_proto (self ) -> DataSourceProto :
166166 """
167167 Converts a SnowflakeSource object to its protobuf representation.
@@ -335,13 +335,11 @@ def __init__(
335335 schema : Optional [str ],
336336 table : Optional [str ],
337337 query : Optional [str ],
338- warehouse : Optional [str ],
339338 ):
340339 self .database = database or ""
341340 self .schema = schema or ""
342341 self .table = table or ""
343342 self .query = query or ""
344- self .warehouse = warehouse or ""
345343
346344 @classmethod
347345 def from_proto (cls , snowflake_options_proto : DataSourceProto .SnowflakeOptions ):
@@ -359,7 +357,6 @@ def from_proto(cls, snowflake_options_proto: DataSourceProto.SnowflakeOptions):
359357 schema = snowflake_options_proto .schema ,
360358 table = snowflake_options_proto .table ,
361359 query = snowflake_options_proto .query ,
362- warehouse = snowflake_options_proto .warehouse ,
363360 )
364361
365362 return snowflake_options
@@ -376,7 +373,6 @@ def to_proto(self) -> DataSourceProto.SnowflakeOptions:
376373 schema = self .schema ,
377374 table = self .table ,
378375 query = self .query ,
379- warehouse = self .warehouse ,
380376 )
381377
382378 return snowflake_options_proto
@@ -393,7 +389,6 @@ def __init__(self, table_ref: str):
393389 schema = None ,
394390 table = table_ref ,
395391 query = None ,
396- warehouse = None ,
397392 )
398393
399394 @staticmethod
0 commit comments