Skip to content

Commit ce15626

Browse files
committed
add assertion
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
1 parent de6645b commit ce15626

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/validation/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def select_values(actual: SingleDataset, expected: SingleDataset, component: str
116116
# Create an index series for both the actual data and the expected data
117117
actual_attr = actual[component][attribute]
118118
expected_attr = expected[component][attribute]
119-
pd_data_fn = pd.DataFrame if actual_attr.ndim == expected_attr.ndim == 2 else pd.Series
119+
assert actual_attr.ndim == expected_attr.ndim in [1, 2]
120+
pd_data_fn = pd.DataFrame if actual_attr.ndim == 2 else pd.Series
120121
actual_values = pd_data_fn(actual_attr, index=actual[component]["id"]).sort_index()
121122
expected_values = pd_data_fn(expected_attr, index=expected[component]["id"]).sort_index()
122123

0 commit comments

Comments
 (0)