Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added branching logic to ww init in nullable types util #4369

Merged
merged 5 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion evalml/utils/nullable_type_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pandas as pd
import woodwork as ww
from woodwork.logical_types import AgeNullable, BooleanNullable, IntegerNullable

DOWNCAST_TYPE_DICT = {
Expand Down Expand Up @@ -57,7 +58,10 @@
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()

Check warning on line 62 in evalml/utils/nullable_type_utils.py

View check run for this annotation

Codecov / codecov/patch

evalml/utils/nullable_type_utils.py#L61-L62

Added lines #L61 - L62 were not covered by tests
else:
y = ww.init_series(y)

Check warning on line 64 in evalml/utils/nullable_type_utils.py

View check run for this annotation

Codecov / codecov/patch

evalml/utils/nullable_type_utils.py#L64

Added line #L64 was not covered by tests

incompatible_logical_types = _get_incompatible_nullable_types(
handle_boolean_nullable,
Expand Down
Loading