@@ -84,7 +84,7 @@ def __init__(
8484 name : str ,
8585 entities : List [str ],
8686 ttl : Union [Duration , timedelta ],
87- batch_source : Optional [ DataSource ] = None ,
87+ batch_source : DataSource ,
8888 stream_source : Optional [DataSource ] = None ,
8989 features : Optional [List [Feature ]] = None ,
9090 tags : Optional [Dict [str , str ]] = None ,
@@ -96,17 +96,18 @@ def __init__(
9696 Raises:
9797 ValueError: A field mapping conflicts with an Entity or a Feature.
9898 """
99- _input = batch_source
100- assert _input is not None
10199
102100 _features = features or []
103101
104102 cols = [entity for entity in entities ] + [feat .name for feat in _features ]
105103 for col in cols :
106- if _input .field_mapping is not None and col in _input .field_mapping .keys ():
104+ if (
105+ batch_source .field_mapping is not None
106+ and col in batch_source .field_mapping .keys ()
107+ ):
107108 raise ValueError (
108- f"The field { col } is mapped to { _input .field_mapping [col ]} for this data source. "
109- f"Please either remove this field mapping or use { _input .field_mapping [col ]} as the "
109+ f"The field { col } is mapped to { batch_source .field_mapping [col ]} for this data source. "
110+ f"Please either remove this field mapping or use { batch_source .field_mapping [col ]} as the "
110111 f"Entity or Feature name."
111112 )
112113
@@ -120,7 +121,7 @@ def __init__(
120121 self .ttl = ttl
121122
122123 self .online = online
123- self .batch_source = _input
124+ self .batch_source = batch_source
124125 self .stream_source = stream_source
125126
126127 self .materialization_intervals = []
0 commit comments