Skip to content

Commit da1fd33

Browse files
committed
fix mypy issues
1 parent c3e91be commit da1fd33

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pandas/core/apply.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def transform(self) -> DataFrame | Series:
232232
func = cast(AggFuncTypeDict, func)
233233
return self.transform_dict_like(func)
234234

235-
if not self.by_row:
235+
if not by_row:
236236
result = obj.apply(func, by_row=by_row, args=args, **kwargs)
237237
else:
238238
# func is either str or callable

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9927,7 +9927,7 @@ def transform(
99279927
stacklevel=find_stack_level(),
99289928
)
99299929

9930-
by_row = False if series_ops_only else "compat"
9930+
by_row: Literal[False, "compat"] = False if series_ops_only else "compat"
99319931

99329932
op = frame_apply(
99339933
self, func=func, axis=axis, args=args, by_row=by_row, kwargs=kwargs

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
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)