You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/20 19:47:25 UTC

[GitHub] [arrow-rs] alamb opened a new pull request, #2114: Add some docstrings for `as_primitive_array` etc

alamb opened a new pull request, #2114:
URL: https://github.com/apache/arrow-rs/pull/2114

   # Which issue does this PR close?
   
   TBD
   <!---
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   # Rationale for this change
    
    <!---
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!---
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!---
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #2114: Improve docstrings + examples for `as_primitive_array` cast functions

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] ursabot commented on pull request #2114: Improve docstrings + examples for `as_primitive_array` cast functions

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114#issuecomment-1191979054

   Benchmark runs are scheduled for baseline = db91031c2cd07f516f8118abf5477c33e0249e0a and contender = f62f26a23540d55356601b7df0730f4f0f2ae5fc. f62f26a23540d55356601b7df0730f4f0f2ae5fc is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/7583c6bc534c4c3db7c0e5908dc61438...7f594f565df8428ca2da379c987b3cfd/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/0e15a524b5e943d382cacecac6136bd7...2527c6283c9c45b1840516092054a2c2/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/fd6c3c2889554ceea0857f6ebe4bbb22...818365b38126490787fe8f0820884f57/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/94b914e3ac0149939c05ddc94e2e1b94...2172cb5661a045c8ab09fb31e298c7e7/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #2114: Add some docstrings for `as_primitive_array` etc

Posted by GitBox <gi...@apache.org>.
viirya commented on code in PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114#discussion_r926884816


##########
arrow/src/array/mod.rs:
##########
@@ -42,6 +44,19 @@
 //! }
 //! ```
 //!
+//! Additionally, there are convenient functions to do this casting
+//! such as [`as_primitive_array<T>`] and [`as_string_array`]:
+//!
+//! ```
+//! # use arrow::array::*;
+//! # use arrow::datatypes::*;
+//! #
+//! fn as_f32_slice(array: &dyn Array) -> &[f32] {
+//!     // use as_primtive_array
+//!     as_primitive_array<Float32Type>().values()

Review Comment:
   typo?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] alamb commented on a diff in pull request #2114: Add some docstrings for `as_primitive_array` etc

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114#discussion_r927010336


##########
arrow/src/array/mod.rs:
##########
@@ -42,6 +44,19 @@
 //! }
 //! ```
 //!
+//! Additionally, there are convenient functions to do this casting
+//! such as [`as_primitive_array<T>`] and [`as_string_array`]:
+//!
+//! ```
+//! # use arrow::array::*;
+//! # use arrow::datatypes::*;
+//! #
+//! fn as_f32_slice(array: &dyn Array) -> &[f32] {
+//!     // use as_primtive_array
+//!     as_primitive_array<Float32Type>().values()

Review Comment:
   Indeed 👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #2114: Add some docstrings for `as_primitive_array` etc

Posted by GitBox <gi...@apache.org>.
viirya commented on code in PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114#discussion_r926885912


##########
arrow/src/array/mod.rs:
##########
@@ -42,6 +44,19 @@
 //! }
 //! ```
 //!
+//! Additionally, there are convenient functions to do this casting
+//! such as [`as_primitive_array<T>`] and [`as_string_array`]:
+//!
+//! ```
+//! # use arrow::array::*;
+//! # use arrow::datatypes::*;
+//! #
+//! fn as_f32_slice(array: &dyn Array) -> &[f32] {
+//!     // use as_primtive_array
+//!     as_primitive_array<Float32Type>().values()

Review Comment:
   ```suggestion
   //!     as_primitive_array::<Float32Type>().values()
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] codecov-commenter commented on pull request #2114: Add some docstrings for `as_primitive_array` etc

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114#issuecomment-1190706316

   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/2114?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2114](https://codecov.io/gh/apache/arrow-rs/pull/2114?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9a8ddb7) into [master](https://codecov.io/gh/apache/arrow-rs/commit/a7181ddbda801ba021398fb264cda394d64bff85?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a7181dd) will **increase** coverage by `0.08%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2114      +/-   ##
   ==========================================
   + Coverage   83.68%   83.76%   +0.08%     
   ==========================================
     Files         224      225       +1     
     Lines       58833    59457     +624     
   ==========================================
   + Hits        49234    49804     +570     
   - Misses       9599     9653      +54     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/2114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [arrow/src/array/cast.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L2Nhc3QucnM=) | `100.00% <ø> (ø)` | |
   | [parquet/src/column/reader/decoder.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvY29sdW1uL3JlYWRlci9kZWNvZGVyLnJz) | `63.38% <0.00%> (-5.86%)` | :arrow_down: |
   | [arrow/src/array/builder/decimal\_builder.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L2J1aWxkZXIvZGVjaW1hbF9idWlsZGVyLnJz) | `83.03% <0.00%> (-2.34%)` | :arrow_down: |
   | [parquet/src/file/statistics.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZmlsZS9zdGF0aXN0aWNzLnJz) | `91.49% <0.00%> (-1.07%)` | :arrow_down: |
   | [arrow/src/compute/kernels/temporal.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy90ZW1wb3JhbC5ycw==) | `94.10% <0.00%> (-0.89%)` | :arrow_down: |
   | [parquet/src/encodings/decoding.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2RlY29kaW5nLnJz) | `88.70% <0.00%> (-0.84%)` | :arrow_down: |
   | [arrow/src/array/builder/boolean\_builder.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L2J1aWxkZXIvYm9vbGVhbl9idWlsZGVyLnJz) | `86.73% <0.00%> (-0.53%)` | :arrow_down: |
   | [parquet/src/data\_type.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZGF0YV90eXBlLnJz) | `74.25% <0.00%> (-0.51%)` | :arrow_down: |
   | [arrow/src/array/builder/generic\_binary\_builder.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L2J1aWxkZXIvZ2VuZXJpY19iaW5hcnlfYnVpbGRlci5ycw==) | `83.33% <0.00%> (-0.46%)` | :arrow_down: |
   | [parquet\_derive/src/parquet\_field.rs](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldF9kZXJpdmUvc3JjL3BhcnF1ZXRfZmllbGQucnM=) | `65.75% <0.00%> (-0.23%)` | :arrow_down: |
   | ... and [41 more](https://codecov.io/gh/apache/arrow-rs/pull/2114/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #2114: Improve docstrings + examples for `as_primitive_array` cast functions

Posted by GitBox <gi...@apache.org>.
tustvold commented on PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114#issuecomment-1191977625

   Merging as clippy failure unrelated to this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #2114: Add some docstrings for `as_primitive_array` etc

Posted by GitBox <gi...@apache.org>.
viirya commented on code in PR #2114:
URL: https://github.com/apache/arrow-rs/pull/2114#discussion_r926885912


##########
arrow/src/array/mod.rs:
##########
@@ -42,6 +44,19 @@
 //! }
 //! ```
 //!
+//! Additionally, there are convenient functions to do this casting
+//! such as [`as_primitive_array<T>`] and [`as_string_array`]:
+//!
+//! ```
+//! # use arrow::array::*;
+//! # use arrow::datatypes::*;
+//! #
+//! fn as_f32_slice(array: &dyn Array) -> &[f32] {
+//!     // use as_primtive_array
+//!     as_primitive_array<Float32Type>().values()

Review Comment:
   typo?
   ```suggestion
   //!     as_primitive_array::<Float32Type>().values()
   ```



##########
arrow/src/array/mod.rs:
##########
@@ -42,6 +44,19 @@
 //! }
 //! ```
 //!
+//! Additionally, there are convenient functions to do this casting
+//! such as [`as_primitive_array<T>`] and [`as_string_array`]:
+//!
+//! ```
+//! # use arrow::array::*;
+//! # use arrow::datatypes::*;
+//! #
+//! fn as_f32_slice(array: &dyn Array) -> &[f32] {
+//!     // use as_primtive_array
+//!     as_primitive_array<Float32Type>().values()

Review Comment:
   typo?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org