Skip to content

Commit d7d3b49

Browse files
committed
“Run” no-op input-only graphs without error.
1 parent 3f64b4e commit d7d3b49

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/clojure/parkour/graph.clj

+3-2
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,10 @@ base configuration `conf` and job name `jname`."
382382

383383
(defmethod node-fn :input
384384
[node conf jname]
385-
(fn [^Job job]
385+
(fn [& [^Job job]]
386386
(if-let [dseq (-> node :config first)]
387-
(vary-meta dseq assoc ::mr/counters (.getCounters job)))))
387+
(cond-> dseq
388+
job (vary-meta assoc ::mr/counters (.getCounters job))))))
388389

389390
(defn ^:private ensure-output-paths!
390391
[job]

test/parkour/graph_test.clj

+9
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,12 @@
208208
(catch Exception e
209209
(-> e .getCause ex-data)))]
210210
(is (:from-task? info))))
211+
212+
(deftest test-noop-input-graph
213+
(th/with-config
214+
(let [inpath (io/resource "word-count-input.txt")
215+
indseq (text/dseq inpath)
216+
word (->> (-> (pg/input indseq)
217+
(pg/fexecute (conf/ig) `noop-input-graph))
218+
(pr/first))]
219+
(is (= "apple" word)))))

0 commit comments

Comments
 (0)