zero323 commented on a change in pull request #34146:
URL: https://github.com/apache/spark/pull/34146#discussion_r730054319



##########
File path: python/pyspark/sql/session.py
##########
@@ -646,23 +647,14 @@ def createDataFrame(
     def createDataFrame(
         self,
         data: Union[
-            "RDD[Union[DateTimeLiteral, LiteralType, DecimalLiteral]]",
-            Iterable[Union["DateTimeLiteral", "LiteralType", 
"DecimalLiteral"]],
+            "RDD[AtomicValue]",
+            Iterable[AtomicValue],
         ],
         schema: Union[AtomicType, str],
         verifySchema: bool = ...,
     ) -> DataFrame:
         ...
 
-    @overload
-    def createDataFrame(
-        self,
-        data: Union["RDD[RowLike]", Iterable["RowLike"]],
-        schema: Union[StructType, str],
-        verifySchema: bool = ...,
-    ) -> DataFrame:
-        ...

Review comment:
       This is not an applicable variant ‒ if schema is `Union[StructType, 
str]` schema is inferred and only the names are used. 

##########
File path: python/pyspark/sql/_typing.pyi
##########
@@ -42,6 +42,8 @@ AtomicDataTypeOrString = Union[pyspark.sql.types.AtomicType, 
str]
 DataTypeOrString = Union[pyspark.sql.types.DataType, str]
 OptionalPrimitiveType = Optional[PrimitiveType]
 
+AtomicValue = TypeVar("AtomicValue", datetime.datetime, datetime.date, 
decimal.Decimal, bool, str, int, float)

Review comment:
       Should it be covariant?




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