Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions python/pyspark/sql/tests/connect/test_connect_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
DoubleType,
LongType,
DecimalType,
BinaryType,
BooleanType,
)
from pyspark.testing.connectutils import should_test_connect
Expand Down Expand Up @@ -153,25 +152,21 @@ def test_cast(self):
df.select(df.id.cast("string")).toPandas(), df2.select(df2.id.cast("string")).toPandas()
)

# Test if the arguments can be passed properly.
# Do not need to check individual behaviour for the ANSI mode thoroughly.
with self.sql_conf({"spark.sql.ansi.enabled": False}):
for x in [
StringType(),
BinaryType(),
ShortType(),
IntegerType(),
LongType(),
FloatType(),
DoubleType(),
ByteType(),
DecimalType(10, 2),
BooleanType(),
DayTimeIntervalType(),
]:
self.assert_eq(
df.select(df.id.cast(x)).toPandas(), df2.select(df2.id.cast(x)).toPandas()
)
for x in [
StringType(),
ShortType(),
IntegerType(),
LongType(),
FloatType(),
DoubleType(),
ByteType(),
DecimalType(10, 2),
BooleanType(),
DayTimeIntervalType(),
]:
self.assert_eq(
df.select(df.id.cast(x)).toPandas(), df2.select(df2.id.cast(x)).toPandas()
)

def test_unsupported_functions(self):
# SPARK-41225: Disable unsupported functions.
Expand Down