Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute nbytes of slice will return the value corresponding to the whole structure #30570

Closed
asfimport opened this issue Dec 10, 2021 · 0 comments

Comments

@asfimport
Copy link

Whether for tables/arrays, slicing and then calling nbytes will return the value for the whole struct. I don't know if this is a bug or the desired behaviour (and if it is I would argue that it should return a result relative to the slice, and also ask if there is any way to get the memory size of my slice?).

 


import pyarrow

pyarrow.__version__

>>> 6.0.0

table = pyarrow.Table.from_arrays([pyarrow.array(['foo', 'bar', 'qux'], type=pyarrow.string())], names=["a"])

table.num_rows

>>> 3

table.nbytes

>>> 25

table.slice(0, 2).num_rows

>>> 2

table.slice(0, 2).nbytes

>>> 25

Reporter: Adrien Hoarau

Note: This issue was originally created as ARROW-15054. Please see the migration documentation for further details.

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

No branches or pull requests

1 participant