snowflakedb / snowflakedb/snowpark-python

SNOW-753219: Add support for "to_arrow" and "from_arrow" methods

Open
#704 2 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
341
Forks
155
Avg merge
4d 16h
Merged PRs (30d)
27

Description

What is the current behavior?

Currently the only way to "export" a snowpark dataframe is by converting it to a pandas dataframe. While this is great, newer alternatives are starting to gain traction, so a way to export to them to other libraries than pandas would be good.

Currently you can convert to a pandas dataframe, and then into other types, but a more direct way would be better.

There is already support for fetch_arrow_all in snowflake-connector, which I believe snowpark already uses, and I've tested it to work with Polars.from_arrow().

What is the desired behavior?

Expose an arrow representation of the dataframe so that it can be picked up by f.ex Polars.from_arrow().

Inversely it would be great to be able to do the reverse operation using polars.to_arrow().

How would this improve snowflake-snowpark-python?

This would allow snowpark to be more flexible as Arrow is becoming widely supported in the data space. It would also allow basic support for other libraries without having adding direct support for certain libraries.

References, Other Background

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Snowpark DataFrame conversion path and inspect how the existing connector fetch_arrow_all support is used. Compare the desired interoperability with Polars.from_arrow() and polars.to_arrow(); done means exposing both Arrow export and reverse conversion without requiring an intermediate pandas DataFrame.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.