Skip to content

Commit d92ce07

Browse files
committed
Bump to 0.11.4
1 parent 659c83b commit d92ce07

File tree

21 files changed

+30
-32
lines changed

21 files changed

+30
-32
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.9.9
22+
rev: v0.11.4
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]

asv_bench/benchmarks/frame_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def setup(self):
517517
self.df = DataFrame(np.random.randn(1000, 100))
518518

519519
self.s = Series(np.arange(1028.0))
520-
self.df2 = DataFrame({i: self.s for i in range(1028)})
520+
self.df2 = DataFrame(dict.fromkeys(range(1028), self.s))
521521
self.df3 = DataFrame(np.random.randn(1000, 3), columns=list("ABC"))
522522

523523
def time_apply_user_func(self):

pandas/_libs/tslibs/timedeltas.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ from typing import (
33
ClassVar,
44
Literal,
55
TypeAlias,
6-
TypeVar,
76
overload,
87
)
98

@@ -60,7 +59,6 @@ UnitChoices: TypeAlias = Literal[
6059
"nanos",
6160
"nanosecond",
6261
]
63-
_S = TypeVar("_S", bound=timedelta)
6462

6563
def get_unit_for_round(freq, creso: int) -> int: ...
6664
def disallow_ambiguous_unit(unit: str | None) -> None: ...
@@ -95,11 +93,11 @@ class Timedelta(timedelta):
9593
_value: int # np.int64
9694
# error: "__new__" must return a class instance (got "Union[Timestamp, NaTType]")
9795
def __new__( # type: ignore[misc]
98-
cls: type[_S],
96+
cls: type[Self],
9997
value=...,
10098
unit: str | None = ...,
10199
**kwargs: float | np.integer | np.floating,
102-
) -> _S | NaTType: ...
100+
) -> Self | NaTType: ...
103101
@classmethod
104102
def _from_value_and_reso(cls, value: np.int64, reso: int) -> Timedelta: ...
105103
@property

pandas/core/apply.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def transform(self) -> DataFrame | Series:
327327
if is_series:
328328
func = {com.get_callable_name(v) or v: v for v in func}
329329
else:
330-
func = {col: func for col in obj}
330+
func = dict.fromkeys(obj, func)
331331

332332
if is_dict_like(func):
333333
func = cast(AggFuncTypeDict, func)

pandas/core/arrays/string_arrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def isin(self, values: ArrayLike) -> npt.NDArray[np.bool_]:
281281
]
282282

283283
# short-circuit to return all False array.
284-
if not len(value_set):
284+
if not value_set:
285285
return np.zeros(len(self), dtype=bool)
286286

287287
result = pc.is_in(

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9705,7 +9705,7 @@ def _where(
97059705
# CoW: Make sure reference is not kept alive
97069706
if cond.ndim == 1 and self.ndim == 2:
97079707
cond = cond._constructor_expanddim(
9708-
{i: cond for i in range(len(self.columns))},
9708+
dict.fromkeys(range(len(self.columns)), cond),
97099709
copy=False,
97109710
)
97119711
cond.columns = self.columns

pandas/core/groupby/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2505,7 +2505,7 @@ def _apply_to_column_groupbys(self, func) -> DataFrame:
25052505
)
25062506
results = [func(sgb) for sgb in sgbs]
25072507

2508-
if not len(results):
2508+
if not results:
25092509
# concat would raise
25102510
res_df = DataFrame([], columns=columns, index=self._grouper.result_index)
25112511
else:

pandas/core/groupby/groupby.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5175,8 +5175,8 @@ def diff(
51755175
shifted = shifted.astype("float32")
51765176
else:
51775177
to_coerce = [c for c, dtype in obj.dtypes.items() if dtype in dtypes_to_f32]
5178-
if len(to_coerce):
5179-
shifted = shifted.astype({c: "float32" for c in to_coerce})
5178+
if to_coerce:
5179+
shifted = shifted.astype(dict.fromkeys(to_coerce, "float32"))
51805180

51815181
return obj - shifted
51825182

pandas/core/internals/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ def replace_list(
805805
for x, y in zip(src_list, dest_list)
806806
if (self._can_hold_element(x) or (self.dtype == "string" and is_re(x)))
807807
]
808-
if not len(pairs):
808+
if not pairs:
809809
return [self.copy(deep=False)]
810810

811811
src_len = len(pairs) - 1

pandas/core/internals/construction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ def _finalize_columns_and_data(
864864
# GH#26429 do not raise user-facing AssertionError
865865
raise ValueError(err) from err
866866

867-
if len(contents) and contents[0].dtype == np.object_:
867+
if contents and contents[0].dtype == np.object_:
868868
contents = convert_object_array(contents, dtype=dtype)
869869

870870
return contents, columns

0 commit comments

Comments
 (0)