Skip to content

Commit

Permalink
[MINOR][CONNECT][PYTHON] Miscellaneous cleanup in Spark Connect compo…
Browse files Browse the repository at this point in the history
…nenet

### What changes were proposed in this pull request?

This PR proposes:
1. Fix the code style in `SparkConnectPlugin.scala` and `SparkBuild.scala` to be consistent with others.
2. Rename `data_frame` to `dataframe` to be consistent with existing PySpark codes.

This Pr is a sort of a followup of apache#37710

### Why are the changes needed?

To follow existing codebase, and style.

### Does this PR introduce _any_ user-facing change?

No, the codes are not released yet. The only notable change would be renaming `data_frame` to `dataframe` to be consistent.

### How was this patch tested?

Ci in this PR should validate the changes.

Closes apache#38121 from HyukjinKwon/minor-cleanup.

Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
HyukjinKwon authored and dongjoon-hyun committed Oct 6, 2022
1 parent 2c62902 commit 7de77e1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class SparkConnectPlugin extends SparkPlugin {
override def driverPlugin(): DriverPlugin = new DriverPlugin {

override def init(
sc: SparkContext,
pluginContext: PluginContext): util.Map[String, String] = {
sc: SparkContext,
pluginContext: PluginContext): util.Map[String, String] = {
SparkConnectService.start()
Map.empty[String, String].asJava
}
Expand Down
20 changes: 10 additions & 10 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -624,25 +624,25 @@ object SparkConnect {
// For some reason the resolution from the imported Maven build does not work for some
// of these dependendencies that we need to shade later on.
libraryDependencies ++= Seq(
"io.grpc" % "protoc-gen-grpc-java" % BuildCommons.gprcVersion asProtocPlugin(),
"org.scala-lang" % "scala-library" % "2.12.16" % "provided",
"com.google.guava" % "guava" % "31.0.1-jre",
"com.google.guava" % "failureaccess" % "1.0.1",
"com.google.protobuf" % "protobuf-java" % protoVersion % "protobuf"
"io.grpc" % "protoc-gen-grpc-java" % BuildCommons.gprcVersion asProtocPlugin(),
"org.scala-lang" % "scala-library" % "2.12.16" % "provided",
"com.google.guava" % "guava" % "31.0.1-jre",
"com.google.guava" % "failureaccess" % "1.0.1",
"com.google.protobuf" % "protobuf-java" % protoVersion % "protobuf"
),

dependencyOverrides ++= Seq(
"com.google.guava" % "guava" % "31.0.1-jre",
"com.google.guava" % "failureaccess" % "1.0.1",
"com.google.protobuf" % "protobuf-java" % protoVersion
"com.google.guava" % "guava" % "31.0.1-jre",
"com.google.guava" % "failureaccess" % "1.0.1",
"com.google.protobuf" % "protobuf-java" % protoVersion
),

(Compile / PB.targets) := Seq(
PB.gens.java -> (Compile / sourceManaged).value,
PB.gens.plugin("grpc-java") -> (Compile / sourceManaged).value
),

(assembly / test) := false,
(assembly / test) := { },

(assembly / logLevel) := Level.Info,

Expand Down Expand Up @@ -1195,7 +1195,7 @@ object CopyDependencies {
// For the SparkConnect build, we manually call the assembly target to
// produce the shaded Jar which happens automatically in the case of Maven.
// Later, when the dependencies are copied, we manually copy the shaded Jar only.
val fid = (LocalProject("connect")/assembly).value
val fid = (LocalProject("connect") / assembly).value

(Compile / dependencyClasspath).value.map(_.data)
.filter { jar => jar.isFile() }
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/sql/connect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
Spark through this API are can be changed at any time without warning."""


from pyspark.sql.connect.data_frame import DataFrame # noqa: F401
from pyspark.sql.connect.dataframe import DataFrame # noqa: F401
2 changes: 1 addition & 1 deletion python/pyspark/sql/connect/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import pyspark.sql.connect.proto.base_pb2_grpc as grpc_lib
import pyspark.sql.types
from pyspark import cloudpickle
from pyspark.sql.connect.data_frame import DataFrame
from pyspark.sql.connect.dataframe import DataFrame
from pyspark.sql.connect.readwriter import DataFrameReader
from pyspark.sql.connect.plan import SQL

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion python/pyspark/sql/connect/readwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

from pyspark.sql.connect.data_frame import DataFrame
from pyspark.sql.connect.dataframe import DataFrame
from pyspark.sql.connect.plan import Read

from typing import TYPE_CHECKING
Expand Down

0 comments on commit 7de77e1

Please sign in to comment.