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

Improve ListArray documentation for slices #7039

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jan 28, 2025

Which issue does this PR close?

Rationale for this change

It was very unclear to me (at first) what I could assume /not assume about a ListArarys values() and offsets arrays when working on #7037

Now that I have studied the code for a while I would like to add documentatation to save myself (and hopefully others) from this trouble again

What changes are included in this PR?

  1. Document what happens with LIstArray and slice

Are there any user-facing changes?

Only docs, no functional changes

Also with ASCII art (I can't help myself)

Screenshot 2025-01-28 at 10 13 39 AM

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 28, 2025
@alamb alamb marked this pull request as ready for review January 28, 2025 15:14
@alamb
Copy link
Contributor Author

alamb commented Jan 28, 2025

fyi @rluvaton

arrow-array/src/array/list_array.rs Outdated Show resolved Hide resolved
arrow-array/src/array/list_array.rs Outdated Show resolved Hide resolved
@tustvold
Copy link
Contributor

FWIW the same behaviour applies to StringArray and LargeStringArray, not sure if we need something similar documented there. There is also something similar for the ViewArray types

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a helper function to know if can use the values and offsets as is? it will be useful for the concat and for other cases when doing optimization regarding list operation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good follow on PR. Thanks @rluvaton

alamb and others added 4 commits January 28, 2025 11:17
Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
Co-authored-by: Raz Luvaton <16746759+rluvaton@users.noreply.github.com>
Co-authored-by: Raz Luvaton <16746759+rluvaton@users.noreply.github.com>
@alamb alamb added the documentation Improvements or additions to documentation label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants