ptxmac commented on code in PR #30:
URL: https://github.com/apache/spark-connect-go/pull/30#discussion_r1666489627


##########
spark/client/channel/channel_test.go:
##########
@@ -18,10 +18,11 @@ package channel_test
 
 import (
        "context"
-       "github.com/apache/spark-connect-go/v35/spark/client/channel"
        "strings"
        "testing"
 
+       "github.com/apache/spark-connect-go/v35/spark/client/channel"
+

Review Comment:
   nit: rm newline



##########
spark/client/channel/channel.go:
##########
@@ -27,6 +27,8 @@ import (
        "strconv"
        "strings"
 
+       "google.golang.org/grpc/credentials/insecure"
+

Review Comment:
   nit: sort imports



##########
cmd/spark-connect-example-spark-session/main.go:
##########
@@ -19,16 +19,15 @@ package main
 import (
        "context"
        "flag"
-       "github.com/apache/spark-connect-go/v35/spark/sql/session"
        "log"
 
+       "github.com/apache/spark-connect-go/v35/spark/sql/session"
+

Review Comment:
   nit: rm newline



##########
spark/sql/session/sparksession.go:
##########
@@ -49,21 +51,27 @@ func (s *SparkSessionBuilder) Remote(connectionString 
string) *SparkSessionBuild
        return s
 }
 
-func (s *SparkSessionBuilder) Build(ctx context.Context) (SparkSession, error) 
{
+func (s *SparkSessionBuilder) ChannelBuilder(cb channel.Builder) 
*SparkSessionBuilder {
+       s.channelBuilder = cb
+       return s
+}
 
-       cb, err := channel.NewBuilder(s.connectionString)
-       if err != nil {
-               return nil, sparkerrors.WithType(fmt.Errorf("failed to connect 
to remote %s: %w", s.connectionString, err), sparkerrors.ConnectionError)
+func (s *SparkSessionBuilder) Build(ctx context.Context) (SparkSession, error) 
{

Review Comment:
   I would have made builder a argument to build:
   ```golang
   func (s *SparkSessionBuilder) Build(ctx context.Context, cb channel.Builder) 
(SparkSession, error) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to