From bd6ccba27e4df46b971521dab6163b18f79f5d0d Mon Sep 17 00:00:00 2001 From: christopherbunn Date: Thu, 27 Jul 2023 12:03:06 -0400 Subject: [PATCH] Replaced version check code --- .../components/transformers/preprocessing/decomposer.py | 2 +- .../tests/component_tests/decomposer_tests/test_decomposer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/evalml/pipelines/components/transformers/preprocessing/decomposer.py b/evalml/pipelines/components/transformers/preprocessing/decomposer.py index 358a5c7b52..3f3d0e0718 100644 --- a/evalml/pipelines/components/transformers/preprocessing/decomposer.py +++ b/evalml/pipelines/components/transformers/preprocessing/decomposer.py @@ -152,7 +152,7 @@ def determine_periodicity( """ # Only need to handle nullable types on pandas < 2. Kept for backwards compatibility with pandas 1.x. - if pd.__version__[0] == "1": + if int(pd.__version__.split(".")[0]) < 2: X, y = cls._handle_nullable_types(cls, X, y) def _get_rel_max_from_acf(y): diff --git a/evalml/tests/component_tests/decomposer_tests/test_decomposer.py b/evalml/tests/component_tests/decomposer_tests/test_decomposer.py index 3f620d78e7..aaf924f626 100644 --- a/evalml/tests/component_tests/decomposer_tests/test_decomposer.py +++ b/evalml/tests/component_tests/decomposer_tests/test_decomposer.py @@ -497,7 +497,7 @@ def test_decomposer_determine_periodicity( pytest.param( False, marks=pytest.mark.xfail( - condition=pd.__version__[0] == "1", + condition=int(pd.__version__.split(".")[0]) < 2, strict=True, raises=AssertionError, reason="pandas 1.x does not recognize np.Nan in Float64 subtracted_floats.",