Factual / drake

Data workflow tool, like a "Make for data"
Other
1.48k stars 110 forks source link

The use of combination %include and method throws java.lang.ClassCastException in 1.0.0 #187

Closed manboubird closed 9 years ago

manboubird commented 9 years ago

The Drakefile is in gist https://gist.github.com/manboubird/21af4c9ef821de77a7fb

$ java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

$ tail ./*
==> ./Drakefile <==
%include vars.drake

echo_method()
  echo "test"

==> ./vars.drake <==
VAR_TEST=var_test

$ java -jar ~/local/Cellar/drake/1.0.0-mr1-cdh4.5.0/drake-1.0.0-mr1-cdh4.5.0-standalone.jar --trace
Drake 1.0.0
Clojure version: {:major 1, :minor 6, :incremental 0, :qualifier nil}
parsed options: {:workflow ./Drakefile, :logfile drake.log, :jobs 1, :plugins plugins.edn, :tmpdir .drake, :trace true}
parsed targets: [=...]
looking for plugins conf file /private/tmp/21af4c9ef821de77a7fb/plugins.edn
no plugins file found at /private/tmp/21af4c9ef821de77a7fb/plugins.edn
Parsing started...
Calculating dependency graph...
Naming steps' temporary directories...
java.lang.ClassCastException: java.lang.Character cannot be cast to java.util.Map$Entry
    at clojure.lang.APersistentMap.cons(APersistentMap.java:42)
    at clojure.lang.RT.conj(RT.java:562)
    at clojure.core$conj.invoke(core.clj:83)
    at drake.parser$fn__3922$fn__3923$fn__3926$fn__3927$fn__3928$fn__3929$fn__3930$fn__3931$fn__3932$fn__3933$fn__3934.invoke(parser.clj:505)
    at clojure.algo.monads$update_val$fn__227.invoke(monads.clj:377)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375.invoke(monads.clj:585)
    at clojure.algo.monads$fn__181$m_bind_maybe__184.invoke(monads.clj:300)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$fn__381$fn__382$fn__383.invoke(monads.clj:596)
    at clojure.core$map$fn__4245.invoke(core.clj:2559)
    at clojure.lang.LazySeq.sval(LazySeq.java:40)
    at clojure.lang.LazySeq.seq(LazySeq.java:49)
    at clojure.lang.RT.seq(RT.java:484)
    at clojure.core$seq.invoke(core.clj:133)
    at clojure.core$drop_while$step__4288.invoke(core.clj:2677)
    at clojure.core$drop_while$fn__4291.invoke(core.clj:2681)
    at clojure.lang.LazySeq.sval(LazySeq.java:40)
    at clojure.lang.LazySeq.seq(LazySeq.java:49)
    at clojure.lang.LazySeq.first(LazySeq.java:71)
    at clojure.lang.RT.first(RT.java:577)
    at clojure.core$first.invoke(core.clj:55)
    at clojure.algo.monads$fn__181$m_plus_maybe__186.doInvoke(monads.clj:302)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:624)
    at clojure.algo.monads$state_t$fn__381$fn__382.invoke(monads.clj:596)
    at drake.parser$fn__3987$fn__3988.invoke(parser.clj:557)
    at name.choi.joshua.fnparse$rep_STAR_$fn__449.invoke(fnparse.clj:265)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at clojure.algo.monads$state_t$m_bind_state_t__373$fn__374.invoke(monads.clj:585)
    at name.choi.joshua.fnparse$rule_match.invoke(fnparse.clj:430)
    at drake.parser$parse_state$fn__4065.invoke(parser.clj:661)
    at clojure.core$with_redefs_fn.invoke(core.clj:6861)
    at drake.parser$parse_state.invoke(parser.clj:658)
    at drake.parser$parse_str.invoke(parser.clj:676)
    at drake.parser$parse_file.invoke(parser.clj:681)
    at drake.core$with_workflow_file.invoke(core.clj:730)
    at drake.core$drake.doInvoke(core.clj:878)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:624)
    at drake.core$_main.doInvoke(core.clj:892)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at drake.core.main(Unknown Source)

core/shutdown: Running standalone; calling (shutdown-agents)
amalloy commented 9 years ago

It looks like I introduced this issue last July, in f9fbbf90eb9e8a534eb75d8ce4a8de616b71561d. I'm not really sure what that change was for, or what the fix is. But we have a cause to look at, now.

amalloy commented 9 years ago

@manboubird Can you confirm that the patch above addresses your issue? It fixed the simple test case I created to reproduce the problem, but I'd like to make sure it also fixes whatever real problem you were having.

manboubird commented 9 years ago

My problem is fixed, too. thanks a lot, @amalloy!