Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Fix some Scala and R warnings
Browse files Browse the repository at this point in the history
(c) Copyright IBM Corp. 2016
  • Loading branch information
peller committed Oct 5, 2016
1 parent c42d2cc commit 7487a0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion kernel-r/declarativewidgets/man/widgets-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Maintainer: \packageMaintainer{declarativewidgets}
}
\references{
~~ Literature or other references for background information ~~
}
~~ Optionally other standard keywords, one per line, from file KEYWORDS in ~~
~~ the R documentation directory ~~
}
\keyword{ package }
\seealso{
~~ Optional links to other man pages, e.g. ~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ trait QuerySupport extends LogLike {
val by = toColExpr(
expr \ "by" match {
case JsString(col) => List(col)
case JsArray(colList:Seq[JsString]) => colList.map(_.as[String]).toList
case JsArray(colList:Seq[_]) => colList.map(_.as[String]).toList
case _ => Nil
}
)

val agg = toArrayOfFuncExpr(
expr \ "agg" match {
case anAgg:JsObject => List(anAgg)
case JsArray(aggList:Seq[JsObject]) => aggList.map(_.as[JsObject]).toList
case JsArray(aggList:Seq[_]) => aggList.map(_.as[JsObject]).toList
case _ => List()

}
)
//rename resultant column names to dataframe format i.e. sum(columnName) -> sum_columnName
Expand All @@ -71,14 +70,14 @@ trait QuerySupport extends LogLike {
val by = toColExpr(
expr \ "by" match {
case JsString(col) => List(col)
case JsArray(colList:Seq[JsString]) => colList.map(_.as[String]).toList
case JsArray(colList:Seq[_]) => colList.map(_.as[String]).toList
case _ => Nil
})

val ascending =
expr \ "ascending" match {
case JsBoolean(asc) => List(asc)
case JsArray(ascList:Seq[JsBoolean]) => ascList.map(_.as[Boolean]).toList
case JsArray(ascList:Seq[_]) => ascList.map(_.as[Boolean]).toList
case _ => Nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object Explore {
def getDfNameFromLastExploreRequest(): String = {
val executingRequest = getExecutingRequest()
val requestTrees = executingRequest.map(_.trees.head.asInstanceOf[reflect.runtime.universe.Tree])
val valDefTrees = requestTrees collect {case c: ValDef => c}
val valDefTrees = requestTrees.map(_.asInstanceOf[ValDef])
val exploreTrees = valDefTrees.filter({ eTree =>
val children = eTree.rhs.children
children.length > 0 && children.head.toString.equals("explore")
Expand Down

0 comments on commit 7487a0a

Please sign in to comment.