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/10/25 23:23:29 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #2928: Improve panic messages for RowSelection::and_then (#2925)

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

   # 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.
   -->
   
   Closes #2925
   
   # 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] ursabot commented on pull request #2928: Improve panic messages for RowSelection::and_then (#2925)

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

   Benchmark runs are scheduled for baseline = ed5843ecea4591e667f0cb1562c11a9eaea22769 and contender = 51d35684507a5a1a818bfb69497011f4e4593b9d. 51d35684507a5a1a818bfb69497011f4e4593b9d 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/b4a6e800cc664a78803c2d48f1c82688...49950c889f964a1f803f6383abd11a2c/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/b9e7e2ff68a44a289311d59c54eb2fac...afa4117c81a04553ac7e0db7a00ff5d3/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/4deef20c191b401abf454ffc283e6472...89b347414a874a4bbe15b52fddf314fd/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/0a53e39025f64e70a2f79a7953969913...6dffea29903a49b29cd91740fa36417f/)
   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 #2928: Improve panic messages for RowSelection::and_then (#2925)

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


##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -223,17 +223,26 @@ impl RowSelection {
     /// returned: NNNNNNNNNNNNYYYYYNNNNYYYYYYYYYYYYYNNNYYNNN
     ///
     ///
+    /// # Panics
+    ///
+    /// Panics if `other` does not have a length equal to the number of rows selected
+    /// by this RowSelection
+    ///
     pub fn and_then(&self, other: &Self) -> Self {
         let mut selectors = vec![];
         let mut first = self.selectors.iter().cloned().peekable();
         let mut second = other.selectors.iter().cloned().peekable();
 
         let mut to_skip = 0;
         while let Some(b) = second.peek_mut() {
-            let a = first.peek_mut().unwrap();
+            let a = first
+                .peek_mut()
+                .expect("selection exceeds the number of selected rows");
 
             if b.row_count == 0 {
-                second.next().unwrap();
+                second
+                    .next()

Review Comment:
   We peek into `second` to get `b`. Why `second.next()` will be None?



-- 
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] waitingkuo commented on pull request #2928: Improve panic messages for RowSelection::and_then (#2925)

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

   LGTM


-- 
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 merged pull request #2928: Improve panic messages for RowSelection::and_then (#2925)

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


-- 
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] waitingkuo commented on a diff in pull request #2928: Improve panic messages for RowSelection::and_then (#2925)

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


##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -223,17 +223,26 @@ impl RowSelection {
     /// returned: NNNNNNNNNNNNYYYYYNNNNYYYYYYYYYYYYYNNNYYNNN
     ///
     ///
+    /// # Panics
+    ///
+    /// Panics if `other` does not have a length equal to the number of rows selected
+    /// by this RowSelection
+    ///
     pub fn and_then(&self, other: &Self) -> Self {
         let mut selectors = vec![];
         let mut first = self.selectors.iter().cloned().peekable();
         let mut second = other.selectors.iter().cloned().peekable();
 
         let mut to_skip = 0;
         while let Some(b) = second.peek_mut() {
-            let a = first.peek_mut().unwrap();
+            let a = first
+                .peek_mut()
+                .expect("selection exceeds the number of selected rows");
 
             if b.row_count == 0 {
-                second.next().unwrap();
+                second
+                    .next()
+                    .expect("selection contains less than the number of selected rows");

Review Comment:
   👍 



-- 
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] waitingkuo commented on a diff in pull request #2928: Improve panic messages for RowSelection::and_then (#2925)

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


##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -223,17 +223,26 @@ impl RowSelection {
     /// returned: NNNNNNNNNNNNYYYYYNNNNYYYYYYYYYYYYYNNNYYNNN
     ///
     ///
+    /// # Panics
+    ///
+    /// Panics if `other` does not have a length equal to the number of rows selected
+    /// by this RowSelection
+    ///
     pub fn and_then(&self, other: &Self) -> Self {
         let mut selectors = vec![];
         let mut first = self.selectors.iter().cloned().peekable();
         let mut second = other.selectors.iter().cloned().peekable();
 
         let mut to_skip = 0;
         while let Some(b) = second.peek_mut() {
-            let a = first.peek_mut().unwrap();
+            let a = first
+                .peek_mut()
+                .expect("selection exceeds the number of selected rows");

Review Comment:
   👍 



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