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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to