-
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.
fix(connect):
count
returns the number of rows in the table
- Loading branch information
1 parent
c30f6a8
commit 041a1ee
Showing
2 changed files
with
23 additions
and
1 deletion.
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
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,13 @@ | ||
from __future__ import annotations | ||
|
||
|
||
def test_count(spark_session): | ||
# Create a range using Spark | ||
# For example, creating a range from 0 to 9 | ||
spark_range = spark_session.range(10) # Creates DataFrame with numbers 0 to 9 | ||
|
||
# Convert to Pandas DataFrame | ||
count = spark_range.count() | ||
|
||
# Verify the DataFrame has expected values | ||
assert count == 10, "DataFrame should have 10 rows" |