You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/06/26 17:11:31 UTC

[GitHub] [spark] xinrong-databricks commented on a diff in pull request #36981: [SPARK-39574][PS] Better error message when `ps.Index` is used for DataFrame/Series creation

xinrong-databricks commented on code in PR #36981:
URL: https://github.com/apache/spark/pull/36981#discussion_r906847674


##########
python/pyspark/pandas/series.py:
##########
@@ -405,6 +405,14 @@ def __init__(  # type: ignore[no-untyped-def]
                 assert not fastpath
                 s = data
             else:
+                from pyspark.pandas.indexes.base import Index
+
+                if isinstance(index, Index):
+                    raise TypeError(
+                        "The given index cannot be a pandas-on-Spark index. "
+                        "Try pandas.Index or array-like."

Review Comment:
   Good idea! Adjusted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org