MCPcopy Index your code
hub / github.com/feast-dev/feast / SnowflakeSource

Class SnowflakeSource

sdk/python/feast/infra/offline_stores/snowflake_source.py:23–313  ·  view source on GitHub ↗

A SnowflakeSource object defines a data source that a SnowflakeOfflineStore class can use.

Source from the content-addressed store, hash-verified

21
22@typechecked
23class SnowflakeSource(DataSource):
24 """A SnowflakeSource object defines a data source that a SnowflakeOfflineStore class can use."""
25
26 def __init__(
27 self,
28 *,
29 name: Optional[str] = None,
30 timestamp_field: Optional[str] = "",
31 database: Optional[str] = None,
32 warehouse: Optional[str] = None,
33 schema: Optional[str] = None,
34 table: Optional[str] = None,
35 query: Optional[str] = None,
36 created_timestamp_column: Optional[str] = "",
37 field_mapping: Optional[Dict[str, str]] = None,
38 description: Optional[str] = "",
39 tags: Optional[Dict[str, str]] = None,
40 owner: Optional[str] = "",
41 ):
42 """
43 Creates a SnowflakeSource object.
44
45 Args:
46 name (optional): Name for the source. Defaults to the table if not specified, in which
47 case the table must be specified.
48 timestamp_field (optional): Event timestamp field used for point in time
49 joins of feature values.
50 database (optional): Snowflake database where the features are stored.
51 schema (optional): Snowflake schema in which the table is located.
52 table (optional): Snowflake table where the features are stored. Exactly one of 'table'
53 and 'query' must be specified.
54 query (optional): The query to be executed to obtain the features. Exactly one of 'table'
55 and 'query' must be specified.
56 created_timestamp_column (optional): Timestamp column indicating when the
57 row was created, used for deduplicating rows.
58 field_mapping (optional): A dictionary mapping of column names in this data
59 source to column names in a feature table or view.
60 description (optional): A human-readable description.
61 tags (optional): A dictionary of key-value pairs to store arbitrary metadata.
62 owner (optional): The owner of the snowflake source, typically the email of the primary
63 maintainer.
64 """
65
66 if warehouse:
67 warnings.warn(
68 "Specifying a warehouse within a SnowflakeSource is to be deprecated."
69 "Starting v0.32.0, the warehouse as part of the Snowflake store config will be used.",
70 RuntimeWarning,
71 )
72
73 if table is None and query is None:
74 raise ValueError('No "table" or "query" argument provided.')
75 if table and query:
76 raise ValueError('Both "table" and "query" argument provided.')
77
78 # The default Snowflake schema is named "PUBLIC".
79 _schema = "PUBLIC" if (database and table and not schema) else schema
80

Callers 8

create_data_sourceMethod · 0.90
driver_repo.pyFile · 0.90
create_data_sourceMethod · 0.90
test_proto_conversionFunction · 0.90
test_file_source_routingFunction · 0.90
from_protoMethod · 0.85
to_data_sourceMethod · 0.85
to_data_sourceMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_proto_conversionFunction · 0.72
test_file_source_routingFunction · 0.72