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 2021/09/30 09:38:58 UTC
[GitHub] [spark] zero323 commented on a change in pull request #34146: [SPARK-36894][PYTHON] Support str schema in RDD.toDF annotations
zero323 commented on a change in pull request #34146:
URL: https://github.com/apache/spark/pull/34146#discussion_r719235781
##########
File path: python/pyspark/rdd.pyi
##########
@@ -445,11 +445,18 @@ class RDD(Generic[T]):
@overload
def toDF(
self: RDD[RowLike],
- schema: Optional[List[str]] = ...,
+ schema: Optional[Union[List[str], Tuple[str, ...]]] = ...,
sampleRatio: Optional[float] = ...,
) -> DataFrame: ...
@overload
- def toDF(self: RDD[RowLike], schema: Optional[StructType] = ...) -> DataFrame: ...
+ def toDF(
+ self: RDD[RowLike], schema: Optional[Union[StructType, str]] = ...
+ ) -> DataFrame: ...
+ @overload
+ def toDF(
+ self: RDD[Union[DateTimeLiteral, LiteralType, DecimalLiteral]],
Review comment:
It seems like this part will requires some changes (switch to `TypeVar`). I'll investigate this and provide an update.
--
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