Skip to content

Commit 3948acc

Browse files
committed
Show DeprecationWarning for FeatureView input parameter only when necessary
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
1 parent 3514495 commit 3948acc

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎sdk/python/feast/feature_view.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,14 @@ def __init__(
9393
Raises:
9494
ValueError: A field mapping conflicts with an Entity or a Feature.
9595
"""
96-
warnings.warn(
97-
(
98-
"The argument 'input' is being deprecated. Please use 'batch_source' "
99-
"instead. Feast 0.13 and onwards will not support the argument 'input'."
100-
),
101-
DeprecationWarning,
102-
)
96+
if input is not None:
97+
warnings.warn(
98+
(
99+
"The argument 'input' is being deprecated. Please use 'batch_source' "
100+
"instead. Feast 0.13 and onwards will not support the argument 'input'."
101+
),
102+
DeprecationWarning,
103+
)
103104

104105
_input = input or batch_source
105106
assert _input is not None

‎sdk/python/tests/integration/registration/test_feature_store.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def test_apply_duplicated_featureview_names(feature_store_with_local_registry):
490490
entities=["driver_id"],
491491
ttl=timedelta(seconds=10),
492492
online=False,
493-
input=FileSource(path="driver_stats.parquet"),
493+
batch_source=FileSource(path="driver_stats.parquet"),
494494
tags={},
495495
)
496496

@@ -499,7 +499,7 @@ def test_apply_duplicated_featureview_names(feature_store_with_local_registry):
499499
entities=["id"],
500500
ttl=timedelta(seconds=10),
501501
online=False,
502-
input=FileSource(path="customer_stats.parquet"),
502+
batch_source=FileSource(path="customer_stats.parquet"),
503503
tags={},
504504
)
505505
try:

0 commit comments

Comments
 (0)