Skip to content

Commit

Permalink
[CHORE] connect: df.schema (#3353)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka authored Nov 26, 2024
1 parent 3ece13a commit 73f94bc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/connect/test_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from __future__ import annotations

from pyspark.sql.types import LongType, StructField, StructType


def test_schema(spark_session):
# Create DataFrame from range(10)
df = spark_session.range(10)

# Define the expected schema
# in reality should 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"

0 comments on commit 73f94bc

Please sign in to comment.