Skip to content

Commit a90fd40

Browse files
committed
fix lint
Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 70213bf commit a90fd40

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

sdk/python/feast/feature_view.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class FeatureView(BaseFeatureView):
5858
ttl: The amount of time this group of features lives. A ttl of 0 indicates that
5959
this group of features lives forever. Note that large ttl's or a ttl of 0
6060
can result in extremely computationally intensive queries.
61-
batch_source: The batch source of data where this group of features
61+
input: The source of data where this group of features is stored.
62+
batch_source (optional): The batch source of data where this group of features
6263
is stored.
6364
stream_source (optional): The stream source of data where this group of features
6465
is stored.
@@ -83,7 +84,8 @@ def __init__(
8384
name: str,
8485
entities: List[str],
8586
ttl: Union[Duration, timedelta],
86-
batch_source: DataSource,
87+
input: Optional[DataSource] = None,
88+
batch_source: Optional[DataSource] = None,
8789
stream_source: Optional[DataSource] = None,
8890
features: Optional[List[Feature]] = None,
8991
tags: Optional[Dict[str, str]] = None,
@@ -95,18 +97,26 @@ def __init__(
9597
Raises:
9698
ValueError: A field mapping conflicts with an Entity or a Feature.
9799
"""
100+
if input is not None:
101+
warnings.warn(
102+
(
103+
"The argument 'input' is being deprecated. Please use 'batch_source' "
104+
"instead. Feast 0.13 and onwards will not support the argument 'input'."
105+
),
106+
DeprecationWarning,
107+
)
108+
109+
_input = input or batch_source
110+
assert _input is not None
98111

99112
_features = features or []
100113

101114
cols = [entity for entity in entities] + [feat.name for feat in _features]
102115
for col in cols:
103-
if (
104-
batch_source.field_mapping is not None
105-
and col in batch_source.field_mapping.keys()
106-
):
116+
if _input.field_mapping is not None and col in _input.field_mapping.keys():
107117
raise ValueError(
108-
f"The field {col} is mapped to {batch_source.field_mapping[col]} for this data source. "
109-
f"Please either remove this field mapping or use {batch_source.field_mapping[col]} as the "
118+
f"The field {col} is mapped to {_input.field_mapping[col]} for this data source. "
119+
f"Please either remove this field mapping or use {_input.field_mapping[col]} as the "
110120
f"Entity or Feature name."
111121
)
112122

@@ -120,7 +130,8 @@ def __init__(
120130
self.ttl = ttl
121131

122132
self.online = online
123-
self.batch_source = batch_source
133+
self.input = _input
134+
self.batch_source = _input
124135
self.stream_source = stream_source
125136

126137
self.materialization_intervals = []
@@ -137,6 +148,7 @@ def __copy__(self):
137148
name=self.name,
138149
entities=self.entities,
139150
ttl=self.ttl,
151+
input=self.input,
140152
batch_source=self.batch_source,
141153
stream_source=self.stream_source,
142154
features=self.features,

0 commit comments

Comments
 (0)