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/08/18 10:42:54 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #37564: [SPARK-40135][PS] Support ps.Index in DataFrame creation

zhengruifeng commented on code in PR #37564:
URL: https://github.com/apache/spark/pull/37564#discussion_r948975259


##########
python/pyspark/pandas/frame.py:
##########
@@ -455,10 +456,14 @@ def __init__(  # type: ignore[no-untyped-def]
                 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."
-                    )
+                    if get_option("compute.ops_on_diff_frames"):
+                        index = index.to_pandas()

Review Comment:
   oh, I misunderstood the task.
   
   in this case, the data should be converted to `SparkDataFrame` or `InternalFrame ` and then joined with the ps.Index, right?



-- 
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