-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection.insertArrowTable fails for esbuild typescript #1708
Comments
Looks like you may have multiple versions of arrow present? |
Potentially similar to what we were seeing over in here: #1545 (reply in thread) from #1640 (comment)
Do you have an apache-arrow version set? I'd expect that it still needs to be set to 15.0.0 to match this the pinned version in duckdb-wasm: |
I think we should try to make arrow more forgiving if there are multiple versions installed but it's never good to have multiple versions of the same library. |
@domoritz Yes I should emphasise I am using a clone of the duckdb-wasm repo. I have built this repo, and I'm using the repos's example programs. There should be no confusion on what the environment is. It seems that the version of arrow captured by duckdb-wasm at build time is not available to downstream code in the Most of the time this doesn't matter as they have identical functionality. It only seems to matter when things like |
@domoritz In this case it is the same version. I think the problem arises because arrow exports different flavours of JavaScript modules. |
Esm and cjs? Hmm, yeah, I can see that that's an issue. |
What happens?
The method
Connection.insertArrowTable
silently fails in a typescript program.To Reproduce
bare-node works
Change the query in
examples/bare-node/index.cjs
from:to:
The table should be created and the query succeeds.
esbuild-node fails
Change the query in
examples/esbuild-node/index.ts
from:to:
This should fail.
Investigation
When I step through the code I notice the failure is in
apache-arrow/ipc/writer.js
in the functionwriteAll
at the statementif (input instanceof table_js_1.Table) {
. In thebare-node
example this istrue
while foresbuild-node
this isfalse
.Furthermore for
bare-node
input.__proto__ === table_js_1.Table.prototype
istrue
, but foresbuild-node
it isfalse
.It appears the internal version of the
apache-arrow
Table
class is different from that of the locally imported one.I note the
bundle.mjs
induckdb-wasm
patches theappache-arrow/package.json
due to the export strategy of theappache-arrow
package. Could this be involved?Browser/Environment:
Chrome 123.0.6312.123
Device:
MacBook Pro (ARM)
DuckDB-Wasm Version:
Latest clone (also 1.28.1-dev179.0)
DuckDB-Wasm Deployment:
The duckdb-wasm repo
Full Name:
Rob Blackbourn
Affiliation:
None
The text was updated successfully, but these errors were encountered: