Skip to content

Commit

Permalink
Added coverage for column labels
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbunn committed Jan 25, 2024
1 parent 4dd9c44 commit d45e07a
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,15 @@ def test_stl_fit_transform_in_sample(

stl = STLDecomposer(period=period)

series_id_columns = ["series_1", "series_2"]
if variateness == "multivariate":
y.columns = series_id_columns

Check warning on line 153 in evalml/tests/component_tests/decomposer_tests/test_stl_decomposer.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/component_tests/decomposer_tests/test_stl_decomposer.py#L151-L153

Added lines #L151 - L153 were not covered by tests

X_t, y_t = stl.fit_transform(X, y)

if variateness == "multivariate":
assert all(y_t.columns == series_id_columns)

Check warning on line 158 in evalml/tests/component_tests/decomposer_tests/test_stl_decomposer.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/component_tests/decomposer_tests/test_stl_decomposer.py#L157-L158

Added lines #L157 - L158 were not covered by tests

# If y_t is a pd.Series, give it columns
if isinstance(y_t, pd.Series):
y_t = y_t.to_frame()
Expand Down Expand Up @@ -179,7 +186,11 @@ def test_stl_fit_transform_in_sample(
# Check the trend to make sure STL worked properly
pd.testing.assert_series_equal(
pd.Series(expected_trend),
pd.Series(stl.trends[0]),
pd.Series(
stl.trends["series_1"]
if variateness == "multivariate"
else stl.trends[0],
),
check_exact=False,
check_index=False,
check_names=False,
Expand Down

0 comments on commit d45e07a

Please sign in to comment.