allisonwang-db commented on code in PR #43450:
URL: https://github.com/apache/spark/pull/43450#discussion_r1373960309


##########
python/pyspark/testing/utils.py:
##########
@@ -328,6 +376,26 @@ def assertSchemaEqual(actual: StructType, expected: 
StructType):
     ?                               ^^                               ^^^^^
     + StructType([StructField('id', StringType(), True), StructField('amount', 
LongType(), True)])
     ?                               ^^^^                              ++++ ^
+
+    Different schemas (ignoring column order)
+
+    >>> s1 = StructType(
+    ...     [StructField("a", IntegerType(), True), StructField("b", 
DoubleType(), True)]
+    ... )
+    >>> s2 = StructType(
+    ...     [StructField("b", DoubleType(), True), StructField("a", 
IntegerType(), True)]
+    ... )
+    >>> assertSchemaEqual(s1, s2, ignoreColumnOrder=True)
+
+    Different schemas (ignoring column names)

Review Comment:
   ```suggestion
       Compare two schemas ignoring the column names
   ```



##########
python/pyspark/testing/utils.py:
##########
@@ -311,11 +342,28 @@ def assertSchemaEqual(actual: StructType, expected: 
StructType):
 
     Examples
     --------
+    >>> from pyspark.pandas.utils import default_session
+    >>> spark = default_session()

Review Comment:
   Why do we need this?



##########
python/pyspark/testing/utils.py:
##########
@@ -328,6 +376,26 @@ def assertSchemaEqual(actual: StructType, expected: 
StructType):
     ?                               ^^                               ^^^^^
     + StructType([StructField('id', StringType(), True), StructField('amount', 
LongType(), True)])
     ?                               ^^^^                              ++++ ^
+
+    Different schemas (ignoring column order)

Review Comment:
   ```suggestion
       Compare two schemas ignoring the column order
   ```



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