@@ -119,8 +119,7 @@ def _ingest_data(self, spec):
119
119
120
120
class TestData (AbstractData ):
121
121
def __init__ (self , spec , test_data ):
122
- if test_data is not None or spec .test_data is not None :
123
- super ().__init__ (spec = spec , name = "test_data" , data = test_data )
122
+ super ().__init__ (spec = spec , name = "test_data" , data = test_data )
124
123
self .dt_column_name = spec .datetime_column .name
125
124
self .target_name = spec .target_column
126
125
@@ -146,6 +145,7 @@ def __init__(
146
145
self .config = config # Store the config for later use
147
146
self .historical_data : HistoricalData = None
148
147
self .additional_data : AdditionalData = None
148
+ self .test_data : TestData = None
149
149
self ._horizon = config .spec .horizon
150
150
self ._datetime_column_name = config .spec .datetime_column .name
151
151
self ._target_col = config .spec .target_column
@@ -156,7 +156,8 @@ def __init__(
156
156
)
157
157
else :
158
158
self ._load_data (config .spec , subset = subset )
159
- self .test_data = TestData (config .spec , test_data )
159
+ if test_data is not None or config .spec .test_data is not None :
160
+ self .test_data = TestData (config .spec , test_data )
160
161
161
162
def _load_data (self , spec , subset = None ):
162
163
"""Loads forecasting input data."""
0 commit comments