From 1f64c4da2c788601a7fbeacc9c9e676eb34d3b4b Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Thu, 1 Jul 2021 16:16:37 -0700 Subject: [PATCH] Remove default list from the FeatureView constructor (#1679) Signed-off-by: Achal Shah --- sdk/python/feast/feature_view.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/python/feast/feature_view.py b/sdk/python/feast/feature_view.py index 3d20b9334f..82b78d1dab 100644 --- a/sdk/python/feast/feature_view.py +++ b/sdk/python/feast/feature_view.py @@ -65,14 +65,16 @@ def __init__( input: DataSource, batch_source: Optional[DataSource] = None, stream_source: Optional[DataSource] = None, - features: List[Feature] = [], + features: List[Feature] = None, tags: Optional[Dict[str, str]] = None, online: bool = True, ): _input = input or batch_source assert _input is not None - cols = [entity for entity in entities] + [feat.name for feat in features] + _features = features or [] + + cols = [entity for entity in entities] + [feat.name for feat in _features] for col in cols: if _input.field_mapping is not None and col in _input.field_mapping.keys(): raise ValueError( @@ -83,7 +85,7 @@ def __init__( self.name = name self.entities = entities - self.features = features + self.features = _features self.tags = tags if tags is not None else {} if isinstance(ttl, Duration):