scicloj / tablecloth

Dataset manipulation library built on the top of tech.ml.dataset
https://scicloj.github.io/tablecloth
MIT License
277 stars 18 forks source link

Add int-string join test from @eraderna #116

Closed otfrom closed 8 months ago

otfrom commented 8 months ago

converting to int-16 can make the left-joins fail

otfrom commented 8 months ago

@genmeblog just wondering if I'm "holding it wrong" or if this should work. We have some code where we do things like read years from csv files as :int16 but when we do a dec or inc on them they get promoted to :int64 and then don't join.

genmeblog commented 8 months ago

I like the idea of providing test cases as a bug issue. Thanks.

TMD fails on this case too:

(-> (j/left-join :z
                 (ds/->dataset [{:z ["foo" (short 2022)]}])
                 (ds/->dataset [{:z ["foo" (long 2022)] :s "2022"}
                                {:z ["foo" (long 2023)] :s "2023"}])))
;; => left-outer-join [2 3]:
;;    |           :z |     :right.z |   :s |
;;    |--------------|--------------|------|
;;    | ["foo" 2022] | ["foo" 2022] | 2022 |
;;    | ["foo" 2022] |              |      |