Skip to content

Commit 4118316

Browse files
committed
Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
This reverts commit 1117c6b.
1 parent d568a1e commit 4118316

File tree

26 files changed

+331
-407
lines changed

26 files changed

+331
-407
lines changed

doc/source/user_guide/style.ipynb

Lines changed: 283 additions & 368 deletions
Large diffs are not rendered by default.

pandas/_config/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def __dir__(self) -> list[str]:
411411

412412

413413
@contextmanager
414-
def option_context(*args) -> Generator[None]:
414+
def option_context(*args) -> Generator[None, None, None]:
415415
"""
416416
Context manager to temporarily set options in a ``with`` statement.
417417
@@ -718,7 +718,7 @@ def _build_option_description(k: str) -> str:
718718

719719

720720
@contextmanager
721-
def config_prefix(prefix: str) -> Generator[None]:
721+
def config_prefix(prefix: str) -> Generator[None, None, None]:
722722
"""
723723
contextmanager for multiple invocations of API with a common prefix
724724

pandas/_config/localization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@contextmanager
2626
def set_locale(
2727
new_locale: str | tuple[str, str], lc_var: int = locale.LC_ALL
28-
) -> Generator[str | tuple[str, str]]:
28+
) -> Generator[str | tuple[str, str], None, None]:
2929
"""
3030
Context manager for temporarily setting a locale.
3131

pandas/_testing/_warnings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def assert_produces_warning(
3535
raise_on_extra_warnings: bool = True,
3636
match: str | tuple[str | None, ...] | None = None,
3737
must_find_all_warnings: bool = True,
38-
) -> Generator[list[warnings.WarningMessage]]:
38+
) -> Generator[list[warnings.WarningMessage], None, None]:
3939
"""
4040
Context manager for running code expected to either raise a specific warning,
4141
multiple specific warnings, or not raise any warnings. Verifies that the code

pandas/_testing/contexts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@contextmanager
3030
def decompress_file(
3131
path: FilePath | BaseBuffer, compression: CompressionOptions
32-
) -> Generator[IO[bytes]]:
32+
) -> Generator[IO[bytes], None, None]:
3333
"""
3434
Open a compressed file and return a file object.
3535
@@ -50,7 +50,7 @@ def decompress_file(
5050

5151

5252
@contextmanager
53-
def set_timezone(tz: str) -> Generator[None]:
53+
def set_timezone(tz: str) -> Generator[None, None, None]:
5454
"""
5555
Context manager for temporarily setting a timezone.
5656
@@ -91,7 +91,7 @@ def setTZ(tz) -> None:
9191

9292

9393
@contextmanager
94-
def ensure_clean(filename=None) -> Generator[Any]:
94+
def ensure_clean(filename=None) -> Generator[Any, None, None]:
9595
"""
9696
Gets a temporary path and agrees to remove on close.
9797
@@ -123,7 +123,7 @@ def ensure_clean(filename=None) -> Generator[Any]:
123123

124124

125125
@contextmanager
126-
def with_csv_dialect(name: str, **kwargs) -> Generator[None]:
126+
def with_csv_dialect(name: str, **kwargs) -> Generator[None, None, None]:
127127
"""
128128
Context manager to temporarily register a CSV dialect for parsing CSV.
129129

pandas/compat/pickle_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def loads(
131131

132132

133133
@contextlib.contextmanager
134-
def patch_pickle() -> Generator[None]:
134+
def patch_pickle() -> Generator[None, None, None]:
135135
"""
136136
Temporarily patch pickle to use our unpickler.
137137
"""

pandas/core/_numba/kernels/min_max_.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ def grouped_min_max(
112112
continue
113113

114114
if is_max:
115-
output[lab] = max(val, output[lab])
115+
if val > output[lab]:
116+
output[lab] = val
116117
else:
117-
output[lab] = min(val, output[lab])
118+
if val < output[lab]:
119+
output[lab] = val
118120

119121
# Set labels that don't satisfy min_periods as np.nan
120122
for lab, count in enumerate(nobs):

pandas/core/apply.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def result_columns(self) -> Index:
806806

807807
@property
808808
@abc.abstractmethod
809-
def series_generator(self) -> Generator[Series]:
809+
def series_generator(self) -> Generator[Series, None, None]:
810810
pass
811811

812812
@staticmethod
@@ -1131,7 +1131,7 @@ class FrameRowApply(FrameApply):
11311131
axis: AxisInt = 0
11321132

11331133
@property
1134-
def series_generator(self) -> Generator[Series]:
1134+
def series_generator(self) -> Generator[Series, None, None]:
11351135
return (self.obj._ixs(i, axis=1) for i in range(len(self.columns)))
11361136

11371137
@staticmethod
@@ -1243,7 +1243,7 @@ def apply_broadcast(self, target: DataFrame) -> DataFrame:
12431243
return result.T
12441244

12451245
@property
1246-
def series_generator(self) -> Generator[Series]:
1246+
def series_generator(self) -> Generator[Series, None, None]:
12471247
values = self.values
12481248
values = ensure_wrapped_if_datetimelike(values)
12491249
assert len(values) > 0

pandas/core/arrays/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ def _generate_range(
29142914
offset: BaseOffset,
29152915
*,
29162916
unit: str,
2917-
) -> Generator[Timestamp]:
2917+
) -> Generator[Timestamp, None, None]:
29182918
"""
29192919
Generates a sequence of dates corresponding to the specified time
29202920
offset. Similar to dateutil.rrule except uses pandas DateOffset

pandas/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def convert_to_list_like(
562562
@contextlib.contextmanager
563563
def temp_setattr(
564564
obj, attr: str, value, condition: bool = True
565-
) -> Generator[None]:
565+
) -> Generator[None, None, None]:
566566
"""
567567
Temporarily set attribute on an object.
568568

0 commit comments

Comments
 (0)