This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-connect-swift.git


The following commit(s) were added to refs/heads/main by this push:
     new f73c824  [SPARK-51787] Remove `sessionID` parameter from 
`getExecutePlanRequest`
f73c824 is described below

commit f73c824105a8576bc1542f39d8a90e0bf4c14c3d
Author: Dongjoon Hyun <dongj...@apache.org>
AuthorDate: Mon Apr 14 11:33:05 2025 +0900

    [SPARK-51787] Remove `sessionID` parameter from `getExecutePlanRequest`
    
    ### What changes were proposed in this pull request?
    
    This PR removes unused parameter `sessionID` from `getExecutePlanRequest`.
    
    ### Why are the changes needed?
    
    We use the existing `self.sessionID` in this method. `sessionID` parameter 
is a leftover during refactoring.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. This is an internal API change.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #55 from dongjoon-hyun/SPARK-51787.
    
    Authored-by: Dongjoon Hyun <dongj...@apache.org>
    Signed-off-by: Dongjoon Hyun <dongj...@apache.org>
---
 Sources/SparkConnect/DataFrame.swift                  | 4 ++--
 Sources/SparkConnect/SparkConnectClient.swift         | 4 ++--
 Tests/SparkConnectTests/SparkConnectClientTests.swift | 9 ++++-----
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/Sources/SparkConnect/DataFrame.swift 
b/Sources/SparkConnect/DataFrame.swift
index 1121473..df6e325 100644
--- a/Sources/SparkConnect/DataFrame.swift
+++ b/Sources/SparkConnect/DataFrame.swift
@@ -139,7 +139,7 @@ public actor DataFrame: Sendable {
       )
     ) { client in
       let service = Spark_Connect_SparkConnectService.Client(wrapping: client)
-      try await 
service.executePlan(spark.client.getExecutePlanRequest(spark.sessionID, plan)) {
+      try await service.executePlan(spark.client.getExecutePlanRequest(plan)) {
         response in
         for try await m in response.messages {
           counter.add(m.arrowBatch.rowCount, ordering: .relaxed)
@@ -158,7 +158,7 @@ public actor DataFrame: Sendable {
       )
     ) { client in
       let service = Spark_Connect_SparkConnectService.Client(wrapping: client)
-      try await 
service.executePlan(spark.client.getExecutePlanRequest(spark.sessionID, plan)) {
+      try await service.executePlan(spark.client.getExecutePlanRequest(plan)) {
         response in
         for try await m in response.messages {
           if m.hasSchema {
diff --git a/Sources/SparkConnect/SparkConnectClient.swift 
b/Sources/SparkConnect/SparkConnectClient.swift
index 6001ee8..d11c4d9 100644
--- a/Sources/SparkConnect/SparkConnectClient.swift
+++ b/Sources/SparkConnect/SparkConnectClient.swift
@@ -222,7 +222,7 @@ public actor SparkConnectClient {
   /// - Parameters:
   ///   - plan: A plan to execute.
   /// - Returns: An ``ExecutePlanRequest`` instance.
-  func getExecutePlanRequest(_ sessionID: String, _ plan: Plan) async
+  func getExecutePlanRequest(_ plan: Plan) async
     -> ExecutePlanRequest
   {
     var request = ExecutePlanRequest()
@@ -402,7 +402,7 @@ public actor SparkConnectClient {
       let service = SparkConnectService.Client(wrapping: client)
       var plan = Plan()
       plan.opType = .command(command)
-      try await service.executePlan(getExecutePlanRequest(sessionID, plan)) {
+      try await service.executePlan(getExecutePlanRequest(plan)) {
         response in
         for try await m in response.messages {
           await self.addResponse(m)
diff --git a/Tests/SparkConnectTests/SparkConnectClientTests.swift 
b/Tests/SparkConnectTests/SparkConnectClientTests.swift
index 399e497..965fb53 100644
--- a/Tests/SparkConnectTests/SparkConnectClientTests.swift
+++ b/Tests/SparkConnectTests/SparkConnectClientTests.swift
@@ -50,17 +50,16 @@ struct SparkConnectClientTests {
   @Test
   func tags() async throws {
     let client = SparkConnectClient(remote: "sc://localhost", user: "test")
-    let sessionID = UUID().uuidString
-    let _ = try await client.connect(sessionID)
+    let _ = try await client.connect(UUID().uuidString)
     let plan = await client.getPlanRange(0, 1, 1)
 
-    #expect(await client.getExecutePlanRequest(sessionID, plan).tags.isEmpty)
+    #expect(await client.getExecutePlanRequest(plan).tags.isEmpty)
     try await client.addTag(tag: "tag1")
 
-    #expect(await client.getExecutePlanRequest(sessionID, plan).tags == 
["tag1"])
+    #expect(await client.getExecutePlanRequest(plan).tags == ["tag1"])
     await client.clearTags()
 
-    #expect(await client.getExecutePlanRequest(sessionID, plan).tags.isEmpty)
+    #expect(await client.getExecutePlanRequest(plan).tags.isEmpty)
     await client.stop()
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to