Skip to content

Commit 9e92e8d

Browse files
committed
API: catch target kwarg clobbering
1 parent bc0993f commit 9e92e8d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/core/generic.py

+3
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,9 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
20902090
def pipe(self, func, *args, **kwargs):
20912091
if isinstance(func, tuple):
20922092
func, target = func
2093+
if target in kwargs:
2094+
msg = '%s is both the pipe target and a keyword argument' % target
2095+
raise ValueError(msg)
20932096
kwargs[target] = self
20942097
return func(*args, **kwargs)
20952098
else:

0 commit comments

Comments
 (0)