diff --git a/tests/connect/test_schema.py b/tests/connect/test_schema.py new file mode 100644 index 0000000000..0e42e1b32c --- /dev/null +++ b/tests/connect/test_schema.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from pyspark.sql.types import StructType, StructField, LongType + + +def test_schema(spark_session): + # Create DataFrame from range(10) + df = spark_session.range(10) + + # Define the expected schema + # in reality shoudl be nullable=False, but daft has all our structs as nullable=True + expected_schema = StructType([StructField("id", LongType(), nullable=True)]) + + # Verify the schema is as expected + assert df.schema == expected_schema, "Schema should match the expected schema"