Skip to content

Commit 4ad4ba1

Browse files
committed
fix mypy issues
1 parent 4e0c5cf commit 4ad4ba1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: pandas/core/apply.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def transform(self) -> DataFrame | Series:
227227
func = cast(AggFuncTypeDict, func)
228228
return self.transform_dict_like(func)
229229

230-
if not self.by_row:
230+
if not by_row:
231231
result = obj.apply(func, by_row=by_row, args=args, **kwargs)
232232
else:
233233
# func is either str or callable

Diff for: pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9921,7 +9921,7 @@ def transform(
99219921
stacklevel=find_stack_level(),
99229922
)
99239923

9924-
by_row = False if series_ops_only else "compat"
9924+
by_row: Literal[False, "compat"] = False if series_ops_only else "compat"
99259925

99269926
op = frame_apply(
99279927
self, func=func, axis=axis, args=args, by_row=by_row, kwargs=kwargs

Diff for: pandas/core/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4636,7 +4636,7 @@ def transform(
46364636
stacklevel=find_stack_level(),
46374637
)
46384638

4639-
by_row = False if series_ops_only else "compat"
4639+
by_row: Literal[False, "compat"] = False if series_ops_only else "compat"
46404640
ser = self.copy(deep=False) if using_copy_on_write() else self
46414641
result = SeriesApply(
46424642
ser, func=func, by_row=by_row, args=args, kwargs=kwargs

0 commit comments

Comments
 (0)