Some comments on interchange API from an Arrow developer
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
調査の方向性
この issue は Column docstring、その null_count property、および dtype docstring を指している。まずこれらのセクションと現在の interchange proposal を読むこと。API ドキュメントまたは design で、Arrow C interface wording、mask and null semantics、variable-size strings、conversions、および nested-data scope を解決すること。未解決の問題について明確な決定と更新された guidance が示されれば完了とする。
索引モデルが issue の本文から書いたものです。
説明
hi all, great to see some continued work on this project after the original discussion from last year. I still think it's useful to allow libraries to "throw data over the wall" without forcing eager serialization to a particular format (like pandas or Arrow)
From Column docstring:
TBD: Arrow has a separate "null" dtype, and has no separate mask concept.
Instead, it seems to use "children" for both columns with a bit mask,
and for nested dtypes. Unclear whether this is elegant or confusing.
This design requires checking the null representation explicitly.
Could you clarify what is confusing? I do not understand the statement 'Instead, it seems to use "children" for both columns with a bit and for nested dtypes.'
Later
The Arrow design requires checking:
1. the ARROW_FLAG_NULLABLE (for sentinel values)
2. if a column has two children, combined with one of those children
having a null dtype.
Making the mask concept explicit seems useful. One null dtype would
not be enough to cover both bit and byte masks, so that would mean
even more checking if we did it the Arrow way.
You mean the Arrow C interface here. Could you clarify what these other things mean?
- If ARROW_FLAG_NULLABLE is set, then the first buffer (the validity bitmap) governs nullness.
- The 2nd item here "if a column has two children, combined with one of those children having a null dtype." does not make sense to me, because nulls in Arrow are exclusively determined by the validity bitmap. Arrow does have a "Null" type, but this represents data whose values are always all null and has no associated buffers.
Re: "One null dtype would not be enough to cover both bit and byte masks, so that would even more checking if we did it the Arrow way.", I don't know what this means, could you clarify?
Column methods
@property
def null_count(self) -> Optional[int]:
"""
Number of null elements, if known.
Note: Arrow uses -1 to indicate "unknown", but None seems cleaner.
"""
pass
Here you should indicate that you mean that the Arrow C interface (where the null_count is an int64)
General comments / questions
- It feels a little unfortunate to go "halfway to Arrow" with adding the string
offsetsbuffer, requiring serialization always for variable-size binary data. I haven't thought through what would be alternatives for string data that do not necessarily force this serialization (similar to the API proposal from https://github.com/wesm/dataframe-protocol/pull/1) — if the goal of this API is to reduce the need to serialize, having some alternative here might be worthwhile - It seems like it would be useful to provide some
to_*methods on Column (likeColumn.to_arrow) — I guess thatpyarrowcould implement a built-in implementation of this interface, but some producers might be able to produce Arrow or NumPy arrays directly and skip the lower-level memory export that's provided here. - Is there interest in supporting nested / non-flat data in this interchange API? I notice that they are explicitly excluded from the
dtypedocstring, but I would encourage you to think about them up front rather than bolting on later.
- 主要言語
- Python
- スター
- 106
- フォーク
- 22
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
data-apis/dataframe-api のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
data-apis/dataframe-api#363 · コメント 1 件 · リアクション 8 件 ·
-
API design
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
data-apis/dataframe-api#356 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
data-apis/dataframe-api#355 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
data-apis/dataframe-api#352 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
data-apis/dataframe-api#351 ·
data-apis/dataframe-api の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
lugassawan/swe-workbench#799 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vllm-project/vllm#61131 ·
メンテナーはふだん 1 日以内に返信
-
Non-string form field names raise AttributeError when files are attached対応中かも @nightcityblade が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kubernetes-client/python#2735 ·
メンテナーはふだん 1 日以内に返信
-
desktop help wanted test
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信