Skip to content
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
2 changes: 1 addition & 1 deletion docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Future Release
* Fix dependency issues (:pr:`2644`, :pr:`2656`)
* Add workaround for pandas 2.2.0 bug with nunique and unpin pandas (:pr:`2657`)
* Changes
* Fix deprecation warnings with is_categorical_dtype (:pr:`2641`)
* Documentation Changes
* Update Featuretools logo to display properly in dark mode (:pr:`2632`)
* Testing Changes
Expand All @@ -21,7 +22,6 @@ Future Release
* Fix minimum dependency checker action (:pr:`2664`)
* Fix Slack alert for tests with Woodwork main branch (:pr:`2668`)


Thanks to the following people for contributing to this release:
:user:`gsheni`, :user:`thehomebrewnerd`, :user:`tamargrey`, :user:`LakshmanKishore`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def last_n(df):
#
# Pandas claims that bug is fixed but it still shows up in some
# cases. More investigation needed.
if pdtypes.is_categorical_dtype(frame.index):
if isinstance(frame.index, pd.CategoricalDtype):
categories = pdtypes.CategoricalDtype(
categories=frame.index.categories,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable, Datetime, Ordinal

Expand Down Expand Up @@ -37,8 +36,8 @@ class GreaterThan(TransformPrimitive):

def get_function(self):
def greater_than(val1, val2):
val1_is_categorical = pdtypes.is_categorical_dtype(val1)
val2_is_categorical = pdtypes.is_categorical_dtype(val2)
val1_is_categorical = isinstance(val1.dtype, pd.CategoricalDtype)
val2_is_categorical = isinstance(val2.dtype, pd.CategoricalDtype)
if val1_is_categorical and val2_is_categorical:
if not all(val1.cat.categories == val2.cat.categories):
return val1.where(pd.isnull, np.nan)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable, Datetime, Ordinal

Expand Down Expand Up @@ -37,8 +36,8 @@ class GreaterThanEqualTo(TransformPrimitive):

def get_function(self):
def greater_than_equal(val1, val2):
val1_is_categorical = pdtypes.is_categorical_dtype(val1)
val2_is_categorical = pdtypes.is_categorical_dtype(val2)
val1_is_categorical = isinstance(val1.dtype, pd.CategoricalDtype)
val2_is_categorical = isinstance(val2.dtype, pd.CategoricalDtype)
if val1_is_categorical and val2_is_categorical:
if not all(val1.cat.categories == val2.cat.categories):
return val1.where(pd.isnull, np.nan)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable, Datetime, Ordinal

Expand Down Expand Up @@ -37,8 +36,8 @@ class LessThan(TransformPrimitive):

def get_function(self):
def less_than(val1, val2):
val1_is_categorical = pdtypes.is_categorical_dtype(val1)
val2_is_categorical = pdtypes.is_categorical_dtype(val2)
val1_is_categorical = isinstance(val1.dtype, pd.CategoricalDtype)
val2_is_categorical = isinstance(val2.dtype, pd.CategoricalDtype)
if val1_is_categorical and val2_is_categorical:
if not all(val1.cat.categories == val2.cat.categories):
return val1.where(pd.isnull, np.nan)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable, Datetime, Ordinal

Expand Down Expand Up @@ -37,8 +36,8 @@ class LessThanEqualTo(TransformPrimitive):

def get_function(self):
def less_than_equal(val1, val2):
val1_is_categorical = pdtypes.is_categorical_dtype(val1)
val2_is_categorical = pdtypes.is_categorical_dtype(val2)
val1_is_categorical = isinstance(val1.dtype, pd.CategoricalDtype)
val2_is_categorical = isinstance(val2.dtype, pd.CategoricalDtype)
if val1_is_categorical and val2_is_categorical:
if not all(val1.cat.categories == val2.cat.categories):
return val1.where(pd.isnull, np.nan)
Expand Down