Skip to content

Commit

Permalink
[FIX] .count() ... WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka committed Nov 21, 2024
1 parent e236332 commit a55f5aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/daft-connect/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ impl SparkConnectService for DaftSparkConnectService {
) -> Result<Response<AnalyzePlanResponse>, Status> {
use spark_connect::analyze_plan_request::*;
let request = request.into_inner();

println!("got analyze plan request: {request:#?}");

let AnalyzePlanRequest {
session_id,
Expand Down
1 change: 1 addition & 0 deletions tests/connect/test_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_alias(spark_session):

# Verify the alias was set correctly
assert df_renamed.schema != df.schema, "Schema should be changed after alias"
assert df_renamed.count() == df.count(), "Row count should be unchanged after alias"

# Verify the data is unchanged but column name is different
df_rows = df.collect()
Expand Down
9 changes: 9 additions & 0 deletions tests/connect/test_count.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from __future__ import annotations


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

# Verify count is correct
assert df.count() == 10, "DataFrame should have 10 rows"

0 comments on commit a55f5aa

Please sign in to comment.