pa.Table has different length than its column
- Lingua principale
- C++
- Stelle
- 17.1k
- Fork
- 4.3k
- Merge medio
- 3g 23h
- PR unite (30g)
- 101
Descrizione
### Describe the bug, including details regarding any error messages, version, and platform.
If I run the following script
```python
import pyarrow as pa
import numpy as np
tables = [
pa.table({"x": [1, 2, 3]}),
pa.table({"x": [4]}),
pa.table({"x": [5, 6]}),
]
sa = pa.concat_tables(tables).to_struct_array().combine_chunks()
offsets = [0, 0, 0, 0]
offsets[1:] = np.cumsum([len(t) for t in tables])
la = pa.ListArray.from_arrays(offsets=offsets, values=sa)
for i in range(3):
value = la[i].values
table = pa.Table.from_struct_array(value)
print(len(value), len(table), len(table["x"]))
```
I get the following output:
```
3 3 6
1 1 1
2 2 2
```
This means that for some reason, table has a different length than one of its constituent columns, which should be impossible!
I am running this using Python 3.12 + PyArrow 21 (installed via conda-forge on Fedora Linux).
### Component(s)
Python
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Esegui la riproduzione Python fornita con PyArrow 21 e ispeziona il percorso da pa.ListArray.from_arrays passando per to_struct_array().combine_chunks() fino a pa.Table.from_struct_array(). Confronta le rispettivi numeri di elementi della tabella e delle colonne per ogni elemento della lista. L'attività è completata quando pa.Table e le colonne che lo costituiscono riportano lunghezze coerenti per questo caso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- numpy, python
- Ambito
- data
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100