uwdata / arquero

Query processing and transformation of array-backed data tables.
https://idl.uw.edu/arquero/
BSD 3-Clause "New" or "Revised" License
1.29k stars 63 forks source link

Join ignores empty string as suffix #317

Closed ghing closed 10 months ago

ghing commented 1 year ago

Join operations (I haven't tested this on all join operations, mostly just noticed it on left joins) will add a default suffix (i.e. "_1") to the common column names even when you explicitly specify an empty string as one of the suffixes.

Example code:

const t1 = aq.table({ colA: ["a", "b", "c"], colB: [3, 4, 5] });
const t2 = aq.table({ colA: ["a", "b", "c"], colB: [6, 7, 8] });
const joined = t1.join_left(t2, "colA", undefined, { suffix: ["", "_new"] });

Expected result:

colA colB colB_new
a 3 6
b 4 7
c 5 8

Observed result:

colA colB_1 colB_new
a 3 6
b 4 7
c 5 8