Jefffrey commented on PR #6913: URL: https://github.com/apache/arrow-rs/pull/6913#issuecomment-2570032937
There's some CI errors to look into. Beyond that, I'm confused by some of the reasoning provided in the body: > But why do I pass a function to build the array and not using Rust trait system? this will surely be cleaner as you can have the actual function implementation hidden behind the input type and it would make the test cleaner. > > You (basically my other self) are right. The problem is that I tried and it can't work without implementing for each primitive type manually (I think), because let's see the following example: > > ... > > all good and it works. the problem is I can't implement it for `bool` when I want to test sorting `BooleanArray` because `ArrowPrimitiveType` can be implemented in the future for `bool` and this would cause duplicate implementation. and for that reason Rust disallow that I find it unlikely that `ArrowPrimitiveType` will be implemented for `bool` in the future, and even if it does I'm sure there'll be other problems such that this test code breaking is one of the smaller issues that would follow. But even disregarding that, none of the tests you've modified are for `BooleanArray`s, so I'm not sure it should be used as an example of why a trait based approach might not work. Of course if a trait based approach is more verbose/complex than the current function based approach I can understand why this approach was chosen. -- 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]
