FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
feast/sdk/python/feast/batch_feature_view.py at master · CodersSampling/feast · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
CodersSampling
/
feast
Public
forked from
feast-dev/feast
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
feast
/
sdk
/
python
/
feast
/
batch_feature_view.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
97 lines (87 loc) · 3.33 KB
Breadcrumbs
feast
/
sdk
/
python
/
feast
/
batch_feature_view.py
Copy path
File metadata and controls
97 lines (87 loc) · 3.33 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import
warnings
from
datetime
import
datetime
,
timedelta
from
typing
import
Dict
,
List
,
Optional
,
Tuple
,
Union
from
feast
import
flags_helper
from
feast
.
data_source
import
DataSource
from
feast
.
entity
import
Entity
from
feast
.
feature_view
import
FeatureView
from
feast
.
field
import
Field
from
feast
.
protos
.
feast
.
core
.
DataSource_pb2
import
DataSource
as
DataSourceProto
warnings
.
simplefilter
(
"once"
,
RuntimeWarning
)
SUPPORTED_BATCH_SOURCES
=
{
"BigQuerySource"
,
"FileSource"
,
"RedshiftSource"
,
"SnowflakeSource"
,
"SparkSource"
,
"TrinoSource"
,
"AthenaSource"
,
}
class
BatchFeatureView
(
FeatureView
):
"""
A batch feature view defines a logical group of features that has only a batch data source.
Attributes:
name: The unique name of the batch feature view.
entities: List of entities or entity join keys.
ttl: The amount of time this group of features lives. A ttl of 0 indicates that
this group of features lives forever. Note that large ttl's or a ttl of 0
can result in extremely computationally intensive queries.
schema: The schema of the feature view, including feature, timestamp, and entity
columns. If not specified, can be inferred from the underlying data source.
source: The batch source of data where this group of features is stored.
online: A boolean indicating whether online retrieval is enabled for this feature view.
description: A human-readable description.
tags: A dictionary of key-value pairs to store arbitrary metadata.
owner: The owner of the batch feature view, typically the email of the primary maintainer.
"""
name
:
str
entities
:
List
[
str
]
ttl
:
Optional
[
timedelta
]
source
:
DataSource
schema
:
List
[
Field
]
entity_columns
:
List
[
Field
]
features
:
List
[
Field
]
online
:
bool
description
:
str
tags
:
Dict
[
str
,
str
]
owner
:
str
timestamp_field
:
str
materialization_intervals
:
List
[
Tuple
[
datetime
,
datetime
]]
def
__init__
(
self
,
*
,
name
:
str
,
source
:
DataSource
,
entities
:
Optional
[
Union
[
List
[
Entity
],
List
[
str
]]]
=
None
,
ttl
:
Optional
[
timedelta
]
=
None
,
tags
:
Optional
[
Dict
[
str
,
str
]]
=
None
,
online
:
bool
=
True
,
description
:
str
=
""
,
owner
:
str
=
""
,
schema
:
Optional
[
List
[
Field
]]
=
None
,
):
if
not
flags_helper
.
is_test
():
warnings
.
warn
(
"Batch feature views are experimental features in alpha development. "
"Some functionality may still be unstable so functionality can change in the future."
,
RuntimeWarning
,
)
if
(
type
(
source
).
__name__
not
in
SUPPORTED_BATCH_SOURCES
and
source
.
to_proto
().
type
!=
DataSourceProto
.
SourceType
.
CUSTOM_SOURCE
):
raise
ValueError
(
f"Batch feature views need a batch source, expected one of
{
SUPPORTED_BATCH_SOURCES
}
"
f"or CUSTOM_SOURCE, got
{
type
(
source
).
__name__
}
:
{
source
.
name
}
instead "
)
super
().
__init__
(
name
=
name
,
entities
=
entities
,
ttl
=
ttl
,
tags
=
tags
,
online
=
online
,
description
=
description
,
owner
=
owner
,
schema
=
schema
,
source
=
source
,
)
Back
|
FazBrowse Home
|
New Git URL