Skip to content

generate-input throws java.lang.IllegalArgumentException when entries in a collection passed use differing underlying types #170

@edporras

Description

@edporras

A coder is only specified when an empty collection is passed to generate-input but not otherwise. This can cause errors such as:

(def x {:a 1 :b 2 :c 3 :d 4 :e 5 :f 6 :g 7 :h 8})
(def y {:a 1 :b 2 :c 3 :d 4 :e 5 :f 6 :g 7 :h 8 :i 9 :j 10})

(.getClass x) ; => clojure.lang.PersistentArrayMap
(.getClass y) ; => clojure.lang.PersistentHashMap

(dt/with-test-pipeline [p (dt/test-pipeline)]
  (let [values [x y]]
    (-> (sut/generate-input values p) ;; throws Unhandled java.lang.IllegalArgumentException
                                      ;; Unable to infer a coder and no Coder was specified.
        (assert/as-iterable))))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions