Skip to content

Commit b2495e9

Browse files
committed
[KYUUBI #2668][FOLLOWUP] Remove unused Option because the collection is never null
### _Why are the changes needed?_ This is a followup of #2668, refactor the code. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2688 from turboFei/dto_batch_request_follow. Closes #2668 1c07c75 [Fei Wang] Follow up for dto classes Authored-by: Fei Wang <fwang12@ebay.com> Signed-off-by: Fei Wang <fwang12@ebay.com>
1 parent 60b9f6b commit b2495e9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private[v1] class SessionsResource extends ApiRequestContext with Logging {
150150
userName,
151151
request.getPassword,
152152
ipAddress,
153-
Option(request.getConfigs.asScala.toMap).getOrElse(Map.empty[String, String]))
153+
request.getConfigs.asScala.toMap)
154154
new SessionHandle(
155155
handle.identifier.publicId,
156156
handle.identifier.secretId,

kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSessionImpl.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class KyuubiBatchSessionImpl(
4242

4343
// TODO: Support batch conf advisor
4444
override val normalizedConf: Map[String, String] =
45-
sessionManager.validateBatchConf(Option(batchRequest.getConf.asScala.toMap)
46-
.getOrElse(Map.empty))
45+
sessionManager.validateBatchConf(batchRequest.getConf.asScala.toMap)
4746

4847
batchRequest.setConf(normalizedConf.asJava)
4948

0 commit comments

Comments
 (0)