You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Takuya Ueshin (Jira)" <ji...@apache.org> on 2025/07/24 18:52:00 UTC
[jira] [Resolved] (SPARK-52592) Can't construct ps.Series from a ps.Series
[ https://issues.apache.org/jira/browse/SPARK-52592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Takuya Ueshin resolved SPARK-52592.
-----------------------------------
Fix Version/s: 4.1.0
Resolution: Fixed
Issue resolved by pull request 51300
[https://github.com/apache/spark/pull/51300]
> Can't construct ps.Series from a ps.Series
> ------------------------------------------
>
> Key: SPARK-52592
> URL: https://issues.apache.org/jira/browse/SPARK-52592
> Project: Spark
> Issue Type: Bug
> Components: Pandas API on Spark, PS
> Affects Versions: 3.2.0
> Reporter: Peter Nguyen
> Assignee: Peter Nguyen
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.1.0
>
>
> I'd like for this to work, but it does not.
> {code:python}
> obj = ps.Series([x for x in range(3)])
> obj = ps.Series(obj)
> {code}
>
> Here's the error:
> {code:java}
> Traceback (most recent call last):
> File "script.py", line 75, in <module>
> obj = ps.Series(obj)
> File ".../pyspark/pandas/series.py", line 422, in __init__
> s = pd.Series(
> File ".../pandas/core/series.py", line 470, in __init__
> data = sanitize_array(data, index, dtype, copy)
> File ".../pandas/core/construction.py", line 618, in sanitize_array
> data = list(data)
> File ".../pyspark/pandas/series.py", line 7339, in __iter__
> return MissingPandasLikeSeries.__iter__(self)
> File ".../pyspark/pandas/missing/__init__.py", line 23, in unsupported_function
> raise PandasNotImplementedError(
> pyspark.pandas.exceptions.PandasNotImplementedError: The method `pd.Series.__iter__()` is not implemented. If you want to collect your data as an NumPy array, use 'to_numpy()' instead.
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org