You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/10/22 15:22:26 UTC
Re: [PR] Improve documentation and examples for `SchemaAdapterFactory`, make `record_batch` "hygenic" [datafusion]
alamb commented on code in PR #13063:
URL: https://github.com/apache/datafusion/pull/13063#discussion_r1810938685
##########
datafusion/common/src/test_util.rs:
##########
@@ -347,7 +347,7 @@ macro_rules! record_batch {
let batch = arrow_array::RecordBatch::try_new(
schema,
vec![$(
- create_array!($type, $values),
+ $crate::create_array!($type, $values),
Review Comment:
Without this the macro errors if `create_array` is not also `use`d
##########
datafusion/core/tests/macro_hygiene/mod.rs:
##########
@@ -37,3 +37,13 @@ mod plan_datafusion_err {
plan_datafusion_err!("foo");
}
}
+
+mod record_batch {
+ // NO other imports!
+ use datafusion_common::record_batch;
+
+ #[test]
+ fn test_macro() {
+ record_batch!(("column_name", Int32, vec![1, 2, 3])).unwrap();
Review Comment:
test that we can use `record_batch` without any other imports
fyi @timsaucer
--
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@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org