kosiew commented on code in PR #22558:
URL: https://github.com/apache/datafusion/pull/22558#discussion_r3332725723
##########
datafusion/physical-plan/src/aggregates/group_values/single_group_by/primitive.rs:
##########
@@ -223,3 +222,58 @@ where
self.map.shrink_to(num_rows, |_| 0); // hasher does not matter since
the map is cleared
}
}
+
+#[cfg(test)]
Review Comment:
Small cleanup idea: since this helper is only used by one test assertion, I
think we can avoid adding the test-only `values_capacity` API.
The child `tests` module should be able to read the private field directly,
so this could be simplified to:
```rust
let capacity_before = gv.values.capacity();
// ...
assert_eq!(gv.values.capacity(), capacity_before, ...);
```
That would let us remove the `#[cfg(test)] impl` without changing behavior.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]