Skip to content

Commit 9fd0c7b

Browse files
author
Alvaro Santiesteban
committed
Remove unnecesary is not None expression
1 parent 5e44364 commit 9fd0c7b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/core/arrays/interval.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ def _simple_new(
195195
left = ensure_index(left, copy=copy)
196196
right = ensure_index(right, copy=copy)
197197

198-
if dtype is not None:
198+
if dtype:
199199
# GH 19262: dtype must be an IntervalDtype to override inferred
200200
dtype = pandas_dtype(dtype)
201201
if not is_interval_dtype(dtype):
202202
msg = f"dtype must be an IntervalDtype, got {dtype}"
203203
raise TypeError(msg)
204-
elif dtype.subtype is not None:
204+
elif dtype.subtype:
205205
left = left.astype(dtype.subtype)
206206
right = right.astype(dtype.subtype)
207207

@@ -637,9 +637,9 @@ def fillna(self, value=None, method=None, limit=None):
637637
-------
638638
filled : IntervalArray with NA/NaN filled
639639
"""
640-
if method is not None:
640+
if method:
641641
raise TypeError("Filling by method is not supported for IntervalArray.")
642-
if limit is not None:
642+
if limit:
643643
raise TypeError("limit is not supported for IntervalArray.")
644644

645645
if not isinstance(value, ABCInterval):
@@ -1149,7 +1149,7 @@ def __arrow_array__(self, type=None):
11491149
children=[storage_array.field(0), storage_array.field(1)],
11501150
)
11511151

1152-
if type is not None:
1152+
if type:
11531153
if type.equals(interval_type.storage_type):
11541154
return storage_array
11551155
elif isinstance(type, ArrowIntervalType):

0 commit comments

Comments
 (0)