Skip to content

Commit 210ca04

Browse files
committed
added test
(cherry picked from commit 2de7d8c)
1 parent 8622582 commit 210ca04

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

sktime/datatypes/tests/test_check.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
import numpy as np
66
import pytest
7+
import pandas
78

89
from sktime.datatypes._check import (
910
AMBIGUOUS_MTYPES,
1011
check_dict,
1112
check_is_mtype,
1213
check_is_scitype,
14+
check_raise,
1315
)
1416
from sktime.datatypes._check import mtype as infer_mtype
1517
from sktime.datatypes._check import scitype as infer_scitype
@@ -471,3 +473,14 @@ def test_scitype_infer(scitype, mtype, fixture_index):
471473
assert scitype == infer_scitype(
472474
fixture, candidate_scitypes=SCITYPES_FOR_INFER_TEST
473475
), f"scitype {scitype} not correctly identified for fixture {fixture_index}"
476+
477+
478+
def test_object_support_for_series_scitype() -> None:
479+
"""Test that passing object dtype does not fail series scitype check."""
480+
481+
sample_dataset = pandas.Series(
482+
np.random.default_rng().choice(["A", "B"], size=(31 + 29 + 31), replace=True),
483+
index=pandas.date_range(start="2000-01-01", end="2000-03-31", freq="D"),
484+
)
485+
486+
assert check_raise(sample_dataset, "pd.Series")

0 commit comments

Comments
 (0)