Skip to content

Conversation

@xbwwj
Copy link

@xbwwj xbwwj commented Sep 30, 2025

What's Changed

This pull request implements Jupyter integration for arrow-js, including the following two mime type:

  • text/html
  • application/vnd.dataresource+json

This implementation basically follows nodejs-polars's implementation.

Closes #245.

@xbwwj
Copy link
Author

xbwwj commented Sep 30, 2025

There is another point to discuss before I can implement it: how many rows and columns to display.

I'm not sure which one is preferable.

@xbwwj
Copy link
Author

xbwwj commented Sep 30, 2025

I also failed to run yarn build with ECONNREFUSED error. How can I run the tests?

@xbwwj
Copy link
Author

xbwwj commented Sep 30, 2025

Here is an example of this integration (can preview on GitHub):

https://gist.github.com/xubaiwang/d56db9d84c671dbaa75901813941bd3b

@domoritz
Copy link
Member

Thanks for the pull request. I think we should not have this function live on the table (if possible) since it cannot be treeshaken. Is there a way to have it outside so we can tree shake the code when it's not needed?

@xbwwj
Copy link
Author

xbwwj commented Sep 30, 2025

@domoritz I think it's currently impossible.

Although it can be moved to a separate function, this is far less useful in Jupyter context. People do not want an extra function to inspect a single value.

Is it possible to create a Deno specific target/platform (called apache-arrow/deno or apache-arrow/jupyter)?
As far as I know, all other JavaScript kernel has discontinued (IJavascript, tslab).

If we make this feature deno/jupyter platform specific (through prototype mutation and .d.ts declare), it will not affect other platforms.

@domoritz
Copy link
Member

Maybe it's small enough to be okay.

Should columns also be supported?

And for perf, does += perform similar to building an array and then joining it into a string?

@xbwwj
Copy link
Author

xbwwj commented Sep 30, 2025

And for perf, does += perform similar to building an array and then joining it into a string?

This is why this is still a draft, there are many things left to implement and optimize.

Should columns also be supported?

Do you mean something like pandas.Series?

Maybe it's small enough to be okay.

However, the final implementation may be non trivial. There are other things like date formatting, json schema creation (for vnd.dataresource+json MIME type), formatting options, etc.

@domoritz
Copy link
Member

I see. So maybe it does make sense to have a separate deno build then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants