Skip to content

Commit

Permalink
Add int-string join test from @eraderna
Browse files Browse the repository at this point in the history
  • Loading branch information
otfrom committed Oct 15, 2023
1 parent 3a0f0e8 commit a67f15b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/tablecloth/api/join_concat_ds_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,16 @@
(api/row-count)) => 4
(-> (api/semi-join ds2 ds1 [:a :b])
(api/row-count)) => 4)

(fact "eraderna int-string join"
(-> (api/left-join (-> (api/dataset [{:i "foo" :y 2022}]))
(-> (api/dataset [{:i "foo" :y 2022 :s "2022"}
{:i "foo" :y 2023 :s "2023"}]))
[:i :y])
(api/rows :as-maps)) => [{:i "foo", :y 2022, :right.i "foo", :right.y 2022, :s "2022"}]
(-> (api/left-join (-> (api/dataset [{:i "foo" :y 2022}])
(api/convert-types {:y :int16}))
(-> (api/dataset [{:i "foo" :y 2022 :s "2022"}
{:i "foo" :y 2023 :s "2023"}]))
[:i :y])
(api/rows :as-maps)) => [{:i "foo", :y 2022, :right.i "foo", :right.y 2022, :s "2022"}])

0 comments on commit a67f15b

Please sign in to comment.