-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e236332
commit b9c9630
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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" |