Skip to content

Commit c53894a

Browse files
committed
fix a few warnings
1 parent 099b9bd commit c53894a

6 files changed

Lines changed: 21 additions & 24 deletions

File tree

module/core/src/main/scala/com/tribbloids/spookystuff/agent/Agent.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import scala.util.Try
1717
/**
1818
* the only implementation should be manually cleaned By ActionLike, so don't set lifespan unless absolutely necessary
1919
*/
20-
class Agent(
20+
class Agent( // TODO: this is actually the harness, not the agent
2121
val spooky: SpookyContext,
2222
override val _lifespan: Lifespan = Lifespan.TaskOrJVM().forShipping
2323
) extends LocalCleanable {

module/core/src/main/scala/com/tribbloids/spookystuff/agent/PythonDriver.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.tribbloids.spookystuff.commons.lifespan.Cleanable.Lifespan
99
import com.tribbloids.spookystuff.commons.{CommonUtils, DSLUtils}
1010
import com.tribbloids.spookystuff.io.{LocalResolver, WriteMode}
1111
import com.tribbloids.spookystuff.utils.SpookyUtils
12-
import com.tribbloids.spookystuff.{CommonConst, PyException, PyInterpretationException, SpookyContext}
12+
import com.tribbloids.spookystuff.{CommonConst, PyInterpretationException, PythonException, SpookyContext}
1313
import org.apache.commons.io.FileUtils
1414
import org.slf4j.LoggerFactory
1515

@@ -151,7 +151,7 @@ class PythonDriver(
151151
try {
152152
this._interpret("exit()")
153153
} catch {
154-
case _: PyException =>
154+
case _: PythonException =>
155155
}
156156
}
157157
Thread.sleep(1000)
@@ -221,7 +221,7 @@ class PythonDriver(
221221
)
222222
return Array.empty[String]
223223
} else {
224-
val ee = new PyException(
224+
val ee = new PyInterpretationException(
225225
indentedCode,
226226
this.outputBuffer,
227227
cause,
@@ -258,9 +258,9 @@ class PythonDriver(
258258
}
259259

260260
private def _interpretCaptureError(
261-
preamble: String = "",
262-
code: String = "",
263-
spookyOpt: Option[SpookyContext] = None
261+
preamble: String,
262+
code: String,
263+
spookyOpt: Option[SpookyContext]
264264
): Array[String] = {
265265

266266
val codeTryExcept =

module/core/src/main/scala/com/tribbloids/spookystuff/doc/Observation.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ object Observation {
5252
}
5353

5454
// all subclasses should be small, will be shipped around by Spark
55+
56+
/**
57+
* always indexed by its UID
58+
*/
5559
@SQLUserDefinedType(udt = classOf[FetchedUDT])
5660
sealed trait Observation extends Serializable {
5761

module/core/src/main/scala/com/tribbloids/spookystuff/exceptions.scala

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ class ActionExceptionWithCoreDump(
3131
) extends ActionException(getMessage_simple, getCause)
3232
with HasCoreDump
3333

34-
class PyException(
35-
val code: String,
36-
val output: String,
34+
trait PythonException extends SpookyException {}
35+
36+
case class PyInterpretationException(
37+
code: String,
38+
output: String,
3739
override val getCause: Throwable = null,
38-
val historyCodeOpt: Option[String] = None
39-
) extends SpookyException {
40+
historyCodeOpt: Option[String] = None
41+
) extends PythonException {
4042

4143
override def getMessage_simple: String =
4244
s"""
@@ -50,18 +52,11 @@ class PyException(
5052
""".stripMargin.trim
5153
}
5254

53-
case class PyInterpretationException(
54-
override val code: String,
55-
override val output: String,
56-
override val getCause: Throwable = null,
57-
override val historyCodeOpt: Option[String] = None
58-
) extends PyException(code, output, getCause, historyCodeOpt)
59-
6055
class DFSReadException(
6156
override val getMessage_simple: String = "",
6257
override val getCause: Throwable = null
6358
) extends IOException(getMessage_simple, getCause)
64-
with SpookyException
59+
with SpookyException {}
6560

6661
class DFSWriteException(
6762
override val getMessage_simple: String = "",

module/core/src/main/scala/com/tribbloids/spookystuff/execution/ExploreRunner.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ case class ExploreRunner[I, O](
9898
val newVs = reducer(effective, oldVs)
9999
open += group -> newVs
100100

101-
open
102101
}
103102

104103
def intoVisited(
@@ -125,7 +124,6 @@ case class ExploreRunner[I, O](
125124

126125
// val __DEBUG = newVs.map(v => v._1.depth)
127126

128-
visited
129127
}
130128
}
131129

module/core/src/test/scala/com/tribbloids/spookystuff/execution/ExploreRunnerSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ExploreRunnerSpec extends SpookyBaseSpec {
3939
dirs.findFirst("path").flatMap(_.text)
4040
}
4141

42-
val plan = Option(ds.plan).collect {
42+
val plan: ExplorePlan[Data.Exploring[Unit], Option[String]] = Option(ds.plan).collect {
4343
case v: ExplorePlan[Data.Exploring[Unit], Option[String]] => v
4444
}.get
4545

@@ -104,7 +104,7 @@ class ExploreRunnerSpec extends SpookyBaseSpec {
104104
action
105105
}
106106

107-
val plan = Option(ds.plan).collect {
107+
val plan: ExplorePlan[Data.Exploring[Unit], Data.Exploring[Option[String]]] = Option(ds.plan).collect {
108108
case v: ExplorePlan[Data.Exploring[Unit], Data.Exploring[Option[String]]] => v
109109
}.get
110110

0 commit comments

Comments
 (0)