+5
-5
lines changedFilter options
+5
-5
lines changed Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ def get_relations() -> Sequence[TypeRelation]:
122
122
@series_handle_nulls
123
123
def contains_op(series: pd.Series, state: dict) -> bool:
124
124
return (
125
-
not pdt.is_categorical_dtype(series)
125
+
not isinstance(series.dtype, pd.CategoricalDtype)
126
126
and pdt.is_string_dtype(series)
127
127
and series_is_string(series, state)
128
128
)
@@ -205,9 +205,9 @@ def get_relations() -> Sequence[TypeRelation]:
205
205
@series_not_empty
206
206
@series_handle_nulls
207
207
def contains_op(series: pd.Series, state: dict) -> bool:
208
-
is_valid_dtype = pdt.is_categorical_dtype(series) and not pdt.is_bool_dtype(
209
-
series
210
-
)
208
+
is_valid_dtype = isinstance(
209
+
series.dtype, pd.CategoricalDtype
210
+
) and not pdt.is_bool_dtype(series)
211
211
if is_valid_dtype:
212
212
return True
213
213
return False
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ def string_is_bool(series: pd.Series, state: dict, k: Dict[str, bool]) -> bool:
31
31
def tester(s: pd.Series, state: dict) -> bool:
32
32
return s.str.lower().isin(k.keys()).all()
33
33
34
-
if pdt.is_categorical_dtype(series):
34
+
if isinstance(series.dtype, pd.CategoricalDtype):
35
35
return False
36
36
37
37
return tester(series, state)
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4