Some comments on interchange API from an Arrow developer
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 20/100
Piste de recherche
L’issue renvoie au Column docstring, à sa propriété null_count et au dtype docstring ; commence par lire ces sections ainsi que le current interchange proposal. Résous la Arrow C interface wording, les mask and null semantics, variable-size strings, conversions et le nested-data scope dans la documentation de l’API ou le design ; le travail est terminé lorsque les questions ouvertes ont des décisions claires et une guidance mise à jour.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 106
- Forks
- 22
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de data-apis/dataframe-api
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
data-apis/dataframe-api#363 · 1 commentaire · 8 réactions ·
-
Row ordering design choiceOuverteAPI design
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
data-apis/dataframe-api#356 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
data-apis/dataframe-api#355 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
data-apis/dataframe-api#352 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
data-apis/dataframe-api#351 ·
Toutes les issues de data-apis/dataframe-api
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
microsoft/markitdown#2820 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
yt-project/yt#5624 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
NousResearch/hermes-agent#148376 ·
Les mainteneurs répondent en général sous 1 jour