stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

silently accept an empty array?

Open Fil opened this issue 2 years ago • 0 comments

even though Arrow doesn't know what to do with the empty array, it seems to me that

a = DuckDBClient.of({ name: [] })

should not throw an error. I'm not sure if this is enough, though (do we want to create an empty table with no columns; possibly respect a .columns property on the empty array)?

A related case is when the array contains tricky objects, for example:

DuckDBClient.of({ name: [{ a: {} }, {}] })

this currently fails with the Arrow error: TypeError: Cannot read properties of undefined (reading 'constructor'), when we could maybe cast to strings (?).

🤔

Fil avatar Nov 24 '22 07:11 Fil