(dfs, args, func)
| 793 | |
| 794 | |
| 795 | def _get_meta_ufunc(dfs, args, func): |
| 796 | dasks = [arg for arg in args if isinstance(arg, (Expr, Array))] |
| 797 | |
| 798 | if len(dfs) >= 2 and not all(hasattr(d, "npartitions") for d in dasks): |
| 799 | # should not occur in current funcs |
| 800 | msg = "elemwise with 2 or more DataFrames and Scalar is not supported" |
| 801 | raise NotImplementedError(msg) |
| 802 | # For broadcastable series, use no rows. |
| 803 | parts = [ |
| 804 | ( |
| 805 | d._meta |
| 806 | if d.ndim == 0 |
| 807 | else ( |
| 808 | np.empty((), dtype=d.dtype) |
| 809 | if isinstance(d, Array) |
| 810 | else meta_nonempty(d._meta) |
| 811 | ) |
| 812 | ) |
| 813 | for d in dasks |
| 814 | ] |
| 815 | |
| 816 | other = [ |
| 817 | (i, arg) for i, arg in enumerate(args) if not isinstance(arg, (Expr, Array)) |
| 818 | ] |
| 819 | |
| 820 | return partial_by_order(*parts, function=func, other=other) |
| 821 | |
| 822 | |
| 823 | class UFuncElemwise(MapPartitions): |
no test coverage detected