thinkharderdev edited a comment on pull request #1983: URL: https://github.com/apache/arrow-datafusion/pull/1983#issuecomment-1068836964
> > Could we use a cfg to achieve the same result. So something like: > > Thanks @thinkharderdev for your suggestion. I used cfg at the beginning. However, I don't know whether this way is acceptable or not. If we all prefer this way, I'll change it back to cfg way. > > By the way, if we use cfg, how to avoid the warning message for _cargo test_, like _"warning: unused variable: `tasks_assigment`"_, _"warning: associated function is never used: `launch_tasks`"_? Yeah, I'm relatively new to this project (and Rust in general) so not sure whether this is an acceptable approach either, but it seems better to me for three reasons: 1. It removes any runtime overhead/branching 2. It doesn't require introducing a flag into a higher-level API 3. It reduces the risk of a runtime bug caused by a misconfiguration/coding error since the runtime binary will never be compiled with the test code. For the warnings I think we can use `#[allow(dead_code)]`, but not sure if there is a way to make that conditional on the `test` attribute or not -- 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]
