You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/03/24 12:02:58 UTC

[PR] Minor: Improve documentation about `ColumnarValues::values_to_array` [arrow-datafusion]

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

   ## Which issue does this PR close?
   
   <!--
   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.
   -->
   
   Related to https://github.com/apache/arrow-datafusion/issues/9773
   
   ## Rationale for this change
   
   Bugs like https://github.com/apache/arrow-datafusion/issues/9773 result from calling `ColumnarValue::into_array` incorrectly and are suble, and likely will only be caught with tests. Let's try and direct poeple to the correct APIs (which are easier anyways)
   
   ## What changes are included in this PR?
   
   Update docs to direct people to the correct API 
   
   
   ## Are these changes tested?
   Existing doc tests
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## 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 `api 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


Re: [PR] Minor: Improve documentation about `ColumnarValues::values_to_array` [arrow-datafusion]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #9774:
URL: https://github.com/apache/arrow-datafusion/pull/9774#discussion_r1536877937


##########
datafusion/expr/src/columnar_value.rs:
##########
@@ -59,8 +62,13 @@ impl ColumnarValue {
         }
     }
 
-    /// Convert a columnar value into an ArrayRef. [`Self::Scalar`] is
-    /// converted by repeating the same scalar multiple times.
+    /// Convert a columnar value into an Arrow [`ArrayRef`] with the specified
+    /// number. of rows. [`Self::Scalar`] is converted by repeating the same

Review Comment:
   ```suggestion
       /// number of rows. [`Self::Scalar`] is converted by repeating the same
   ```



-- 
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


Re: [PR] Minor: Improve documentation about `ColumnarValues::values_to_array` [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #9774:
URL: https://github.com/apache/arrow-datafusion/pull/9774


-- 
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


Re: [PR] Minor: Improve documentation about `ColumnarValues::values_to_array` [arrow-datafusion]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #9774:
URL: https://github.com/apache/arrow-datafusion/pull/9774#discussion_r1536877885


##########
datafusion/expr/src/columnar_value.rs:
##########
@@ -26,11 +26,14 @@ use datafusion_common::{internal_err, Result, ScalarValue};
 use std::sync::Arc;
 
 /// Represents the result of evaluating an expression: either a single
-/// `ScalarValue` or an [`ArrayRef`].
+/// [`ScalarValue`] or an [`ArrayRef`].
 ///
 /// While a [`ColumnarValue`] can always be converted into an array
 /// for convenience, it is often much more performant to provide an
 /// optimized path for scalar values.
+///
+/// See [ColumnarValue::values_to_arrays] for a function that converts

Review Comment:
   ```suggestion
   /// See [`ColumnarValue::values_to_arrays`] for a function that converts
   ```



-- 
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


Re: [PR] Minor: Improve documentation about `ColumnarValues::values_to_array` [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9774:
URL: https://github.com/apache/arrow-datafusion/pull/9774#issuecomment-2016970807

   Thank you for the review @viirya 


-- 
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