Skip to content

Commit 8c6a994

Browse files
simonjayhawkinsjreback
authored andcommitted
CLN: various lgtm.com cleanups (#30258)
1 parent 2c2e5ac commit 8c6a994

File tree

19 files changed

+56
-21
lines changed

19 files changed

+56
-21
lines changed

pandas/core/apply.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ def apply_series_generator(self) -> Tuple[ResType, "Index"]:
320320
series_gen = self.series_generator
321321
res_index = self.result_index
322322

323-
i = None
324323
keys = []
325324
results = {}
326325
if self.ignore_failures:

pandas/core/arrays/datetimes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2109,7 +2109,6 @@ def _validate_dt64_dtype(dtype):
21092109
dtype = pandas_dtype(dtype)
21102110
if is_dtype_equal(dtype, np.dtype("M8")):
21112111
# no precision, disallowed GH#24806
2112-
dtype = _NS_DTYPE
21132112
msg = (
21142113
"Passing in 'datetime64' dtype with no precision is not allowed. "
21152114
"Please pass in 'datetime64[ns]' instead."

pandas/core/arrays/integer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def itemsize(self):
7878

7979
@classmethod
8080
def construct_array_type(cls):
81-
"""Return the array type associated with this dtype
81+
"""
82+
Return the array type associated with this dtype.
8283
8384
Returns
8485
-------

pandas/core/arrays/numpy_.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ def construct_from_string(cls, string):
7979
f"Cannot construct a 'PandasDtype' from '{string}'"
8080
) from err
8181

82+
@classmethod
8283
def construct_array_type(cls):
84+
"""
85+
Return the array type associated with this dtype.
86+
87+
Returns
88+
-------
89+
type
90+
"""
8391
return PandasArray
8492

8593
@property

pandas/core/arrays/sparse/dtype.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ def __repr__(self) -> str:
168168

169169
@classmethod
170170
def construct_array_type(cls):
171+
"""
172+
Return the array type associated with this dtype.
173+
174+
Returns
175+
-------
176+
type
177+
"""
171178
from .array import SparseArray
172179

173180
return SparseArray

pandas/core/arrays/timedeltas.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,6 @@ def _validate_td64_dtype(dtype):
11221122
dtype = pandas_dtype(dtype)
11231123
if is_dtype_equal(dtype, np.dtype("timedelta64")):
11241124
# no precision disallowed GH#24806
1125-
dtype = _TD_DTYPE
11261125
msg = (
11271126
"Passing in 'timedelta' dtype with no precision is not allowed. "
11281127
"Please pass in 'timedelta64[ns]' instead."

pandas/core/dtypes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def names(self) -> Optional[List[str]]:
183183
@classmethod
184184
def construct_array_type(cls):
185185
"""
186-
Return the array type associated with this dtype
186+
Return the array type associated with this dtype.
187187
188188
Returns
189189
-------

pandas/core/dtypes/dtypes.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def _hash_categories(categories, ordered: Ordered = True) -> int:
486486
@classmethod
487487
def construct_array_type(cls):
488488
"""
489-
Return the array type associated with this dtype
489+
Return the array type associated with this dtype.
490490
491491
Returns
492492
-------
@@ -668,7 +668,7 @@ def __init__(self, unit="ns", tz=None):
668668
unit = result.unit
669669
tz = result.tz
670670
msg = (
671-
"Passing a dtype alias like 'datetime64[ns, {tz}]' "
671+
f"Passing a dtype alias like 'datetime64[ns, {tz}]' "
672672
"to DatetimeTZDtype is no longer supported. Use "
673673
"'DatetimeTZDtype.construct_from_string()' instead."
674674
)
@@ -704,7 +704,7 @@ def tz(self):
704704
@classmethod
705705
def construct_array_type(cls):
706706
"""
707-
Return the array type associated with this dtype
707+
Return the array type associated with this dtype.
708708
709709
Returns
710710
-------
@@ -936,6 +936,13 @@ def is_dtype(cls, dtype) -> bool:
936936

937937
@classmethod
938938
def construct_array_type(cls):
939+
"""
940+
Return the array type associated with this dtype.
941+
942+
Returns
943+
-------
944+
type
945+
"""
939946
from pandas.core.arrays import PeriodArray
940947

941948
return PeriodArray
@@ -1030,7 +1037,7 @@ def subtype(self):
10301037
@classmethod
10311038
def construct_array_type(cls):
10321039
"""
1033-
Return the array type associated with this dtype
1040+
Return the array type associated with this dtype.
10341041
10351042
Returns
10361043
-------

pandas/core/frame.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2587,7 +2587,6 @@ def _ixs(self, i: int, axis: int = 0):
25872587
"""
25882588
# irow
25892589
if axis == 0:
2590-
label = self.index[i]
25912590
new_values = self._data.fast_xs(i)
25922591

25932592
# if we are a copy, mark as such

pandas/core/generic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5746,8 +5746,6 @@ def __deepcopy__(self: FrameOrSeries, memo=None) -> FrameOrSeries:
57465746
memo, default None
57475747
Standard signature. Unused
57485748
"""
5749-
if memo is None:
5750-
memo = {}
57515749
return self.copy(deep=True)
57525750

57535751
def _convert(

0 commit comments

Comments
 (0)