Skip to content

Refine documentation for unary_mut and binary_mut#5798

Merged
alamb merged 5 commits intoapache:masterfrom
alamb:alamb/op_docs
Jun 6, 2024
Merged

Refine documentation for unary_mut and binary_mut#5798
alamb merged 5 commits intoapache:masterfrom
alamb:alamb/op_docs

Conversation

@alamb
Copy link
Copy Markdown
Contributor

@alamb alamb commented May 24, 2024

Which issue does this PR close?

N/A

Rationale for this change

I ran into someone at a conference yesterday who was saying they hadn't been
able to figure out how to modify arrays in place. @tustvold pointed out to me it
is possible but the documentation for binary_mut and unary_mut was
not as clear as it could be,

I had the code up for #5792 anyways so I figured I would bang out this improvement as well

What changes are included in this PR?

  1. Update documentation and add examples showing how this would work

This ended up being larger than I expected as I opened the docs and was imaginging "how would a random person who didn't understand the details of arrow-rs use this feature"

Are there any user-facing changes?

Doc changes only, no code changes

@github-actions github-actions Bot added the arrow Changes to the arrow crate label May 24, 2024
Comment thread arrow-array/src/array/primitive_array.rs Outdated
Comment thread arrow-array/src/array/primitive_array.rs Outdated
Comment thread arrow-array/src/array/primitive_array.rs Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is obvious how to go from Arc<dyn Array> back to PrimitiveArray so I documented that too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed this to show you can make a different type

Copy link
Copy Markdown
Contributor Author

@alamb alamb May 24, 2024

Choose a reason for hiding this comment

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

This is an example I imagine someone might be looking for (like I would be)

Comment thread arrow-arith/src/arity.rs Outdated
Comment thread arrow-array/src/array/primitive_array.rs Outdated
@alamb alamb marked this pull request as ready for review May 24, 2024 14:45
Comment thread arrow-array/src/array/primitive_array.rs Outdated
@alamb
Copy link
Copy Markdown
Contributor Author

alamb commented May 30, 2024

I think this PR is ready for review

I have filed #5770 to track the "binary_mut" type check

@alamb
Copy link
Copy Markdown
Contributor Author

alamb commented May 30, 2024

I believe CI is failing due to #5815

@alamb
Copy link
Copy Markdown
Contributor Author

alamb commented Jun 4, 2024

I plan to merge this PR in the next day or two unless there is any additional commentary. It adds test coverage and changes docs -- if we find issues or additional improvements we can do them as follow on PRs

@alamb alamb merged commit 087f34b into apache:master Jun 6, 2024
@alamb alamb added the documentation Improvements or additions to documentation label Jun 6, 2024
@alamb alamb deleted the alamb/op_docs branch June 6, 2024 11:29
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.

4 participants