Skip to content

Commit 68b7341

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 37f7a61 commit 68b7341

File tree

21 files changed

+33
-33
lines changed

21 files changed

+33
-33
lines changed

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, None, None]:
414+
def option_context(*args) -> Generator[None]:
415415
"""
416416
Context manager to temporarily set options in a ``with`` statement.
417417
@@ -713,7 +713,7 @@ def _build_option_description(k: str) -> str:
713713

714714

715715
@contextmanager
716-
def config_prefix(prefix: str) -> Generator[None, None, None]:
716+
def config_prefix(prefix: str) -> Generator[None]:
717717
"""
718718
contextmanager for multiple invocations of API with a common prefix
719719

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], None, None]:
28+
) -> Generator[str | tuple[str, str]]:
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], None, None]:
38+
) -> Generator[list[warnings.WarningMessage]]:
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], None, None]:
32+
) -> Generator[IO[bytes]]:
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, None, None]:
53+
def set_timezone(tz: str) -> Generator[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, None, None]:
94+
def ensure_clean(filename=None) -> Generator[Any]:
9595
"""
9696
Gets a temporary path and agrees to remove on close.
9797
@@ -123,7 +123,7 @@ def ensure_clean(filename=None) -> Generator[Any, None, None]:
123123

124124

125125
@contextmanager
126-
def with_csv_dialect(name: str, **kwargs) -> Generator[None, None, None]:
126+
def with_csv_dialect(name: str, **kwargs) -> Generator[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, None, None]:
134+
def patch_pickle() -> Generator[None]:
135135
"""
136136
Temporarily patch pickle to use our unpickler.
137137
"""

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, None, None]:
809+
def series_generator(self) -> Generator[Series]:
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, None, None]:
1134+
def series_generator(self) -> Generator[Series]:
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, None, None]:
1246+
def series_generator(self) -> Generator[Series]:
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
@@ -2906,7 +2906,7 @@ def _generate_range(
29062906
offset: BaseOffset,
29072907
*,
29082908
unit: str,
2909-
) -> Generator[Timestamp, None, None]:
2909+
) -> Generator[Timestamp]:
29102910
"""
29112911
Generates a sequence of dates corresponding to the specified time
29122912
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, None, None]:
565+
) -> Generator[None]:
566566
"""
567567
Temporarily set attribute on an object.
568568

pandas/core/groupby/ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ def _unob_index_and_ids(
865865
return unob_index, unob_ids
866866

867867
@final
868-
def get_group_levels(self) -> Generator[Index, None, None]:
868+
def get_group_levels(self) -> Generator[Index]:
869869
# Note: only called from _insert_inaxis_grouper, which
870870
# is only called for BaseGrouper, never for BinGrouper
871871
result_index = self.result_index

pandas/core/indexes/multi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2623,7 +2623,7 @@ def _reorder_ilevels(self, order) -> MultiIndex:
26232623

26242624
def _recode_for_new_levels(
26252625
self, new_levels, copy: bool = True
2626-
) -> Generator[np.ndarray, None, None]:
2626+
) -> Generator[np.ndarray]:
26272627
if len(new_levels) > self.nlevels:
26282628
raise AssertionError(
26292629
f"Length of new_levels ({len(new_levels)}) "

0 commit comments

Comments
 (0)