-
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
e7c6d9b
commit 146637f
Showing
2 changed files
with
14 additions
and
13 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,14 @@ | ||
from __future__ import annotations | ||
|
||
|
||
def test_range_first(spark_session): | ||
spark_range = spark_session.range(10) | ||
first_row = spark_range.first() | ||
assert first_row["id"] == 0, "First row should have id=0" | ||
|
||
|
||
def test_range_limit(spark_session): | ||
spark_range = spark_session.range(10) | ||
limited_df = spark_range.limit(5).toPandas() | ||
assert len(limited_df) == 5, "Limited DataFrame should have 5 rows" | ||
assert list(limited_df["id"]) == list(range(5)), "Limited DataFrame should contain values 0-4" |
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