Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20531#discussion_r166619371
--- Diff: python/pyspark/worker.py ---
@@ -116,7 +116,7 @@ def wrap_grouped_agg_pandas_udf(f, return_type):
def wrapped(*series):
import pandas as pd
result = f(*series)
- return pd.Series(result)
+ return pd.Series([result])
--- End diff --
This change seems to be required:
```python
>>> import numpy as np
>>> import pandas as pd
>>> pd.Series(np.array([1, 2, 3]))
0 1
1 2
2 3
dtype: int64
>>> pd.Series([np.array([1, 2, 3])])
0 [1, 2, 3]
dtype: object
>>> pd.Series(1)
0 1
dtype: int64
>>> pd.Series([1])
0 1
dtype: int64
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]