techascent / tech.ml.dataset

A Clojure high performance data processing system
Eclipse Public License 1.0
680 stars 35 forks source link

ClassCastException when using into on Instant column #413

Closed mk closed 2 months ago

mk commented 2 months ago

We're running into a ClassCastException when using a tech.v3.dataset with Clerk, originally reported as nextjournal/clerk#677. Here's a small repro using techascent/tech.ml.dataset {:mvn/version "7.030"}:

(require '[tech.v3.dataset :as ds])

(def ds
  (ds/->dataset {:x (range 5)
                 :y (repeatedly 5 #(java.time.Instant/now))}))

(into [] (take 3) (:x ds)) ;; works
(into [] (take 3) (:y ds)) ;; throws ClassCastException: class clojure.lang.Reduced cannot be cast to class clojure.lang.ITransientCollection (clojure.lang.Reduced and clojure.lang.ITransientCollection are in unnamed module of loader 'app')

Is this expected behavior or a bug that could be fixed?

cnuernber commented 2 months ago

Yes I believe it is a bug; we will look into it - thanks for the report.