From 8ebe76179209eeb2fb400b7719ba9b4bfe7246ff Mon Sep 17 00:00:00 2001 From: MichaelFu512 Date: Wed, 13 Dec 2023 09:31:45 -0800 Subject: [PATCH 1/2] added branching logic to ww init --- evalml/utils/nullable_type_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evalml/utils/nullable_type_utils.py b/evalml/utils/nullable_type_utils.py index afe84e1a93..4f9d64691f 100644 --- a/evalml/utils/nullable_type_utils.py +++ b/evalml/utils/nullable_type_utils.py @@ -1,4 +1,5 @@ import pandas as pd +import woodwork as ww from woodwork.logical_types import AgeNullable, BooleanNullable, IntegerNullable DOWNCAST_TYPE_DICT = { @@ -57,7 +58,10 @@ def _downcast_nullable_y(y, handle_boolean_nullable=True, handle_integer_nullabl y with any incompatible nullable types downcasted to compatible equivalents. """ if y.ww.schema is None: - y.ww.init() + if isinstance(y, pd.DataFrame): + y.ww.init() + else: + y = ww.init_series(y) incompatible_logical_types = _get_incompatible_nullable_types( handle_boolean_nullable, From 72d8f33454415ba52ce4e270f156a4ded7c8d5b5 Mon Sep 17 00:00:00 2001 From: MichaelFu512 Date: Wed, 13 Dec 2023 15:31:04 -0800 Subject: [PATCH 2/2] release notes --- docs/source/release_notes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index c4c8bb519b..ed57e0877a 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -3,6 +3,7 @@ Release Notes **Future Releases** * Enhancements * Fixes + * Fixed bug in `_downcast_nullable_y` causing woodwork initialization issues :pr:`4369` * Changes * Documentation Changes * Testing Changes