Skip to content

Commit a6ed1b2

Browse files
authored
Warn when meta is passed to apply (#10256)
1 parent 5064339 commit a6ed1b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dask/dataframe/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4330,6 +4330,15 @@ def apply(self, func, convert_dtype=no_default, meta=no_default, args=(), **kwds
43304330
M.apply, self._meta_nonempty, func, args=args, udf=True, **kwds
43314331
)
43324332
warnings.warn(meta_warning(meta))
4333+
elif PANDAS_GT_210:
4334+
test_meta = make_meta(meta)
4335+
if is_dataframe_like(test_meta):
4336+
warnings.warn(
4337+
"Returning a DataFrame from Series.apply when the supplied function "
4338+
"returns a Series is deprecated and will be removed in a future version.",
4339+
FutureWarning,
4340+
stacklevel=2,
4341+
)
43334342

43344343
return map_partitions(methods.apply, self, func, args=args, meta=meta, **kwds)
43354344

0 commit comments

Comments
 (0)