Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
self review
  • Loading branch information
juliuszsompolski committed Jul 20, 2023
commit 3655ebf12270acf6682fca2a4c080f95c714a6fe
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ private[sql] class SparkConnectClient(
}

private[sql] def addTag(tag: String): Unit = {
// validation is also done server side, but this will give error earlier.
ProtoUtils.throwIfInvalidTag(tag)
tags.get += tag
}

private[sql] def removeTag(tag: String): Unit = {
// validation is also done server side, but this will give error earlier.
ProtoUtils.throwIfInvalidTag(tag)
tags.get.remove(tag)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ private[connect] object ProtoUtils {
// because the Spark Connect job tag is also used as part of SparkContext job tag.
// See SparkContext.throwIfInvalidTag and ExecuteHolder.tagToSparkJobTag
if (tag == null) {
throw new IllegalArgumentException("Spark Connect execution tag cannot be null.")
throw new IllegalArgumentException("Spark Connect tag cannot be null.")
}
if (tag.contains(SPARK_JOB_TAGS_SEP)) {
throw new IllegalArgumentException(
s"Spark Connect execution tag cannot contain '$SPARK_JOB_TAGS_SEP'.")
s"Spark Connect tag cannot contain '$SPARK_JOB_TAGS_SEP'.")
}
if (tag.isEmpty) {
throw new IllegalArgumentException("Spark Connect execution tag cannot be an empty string.")
throw new IllegalArgumentException("Spark Connect tag cannot be an empty string.")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private[connect] class ExecuteResponseObserver[T](val executeHolder: ExecuteHold
}

/**
* Make sure that response fields that common should be set in every response are populated.
* Populate response fields that are common and should be set in every response.
*/
private def setCommonResponseFields(response: T): T = {
response match {
Expand Down