From a2f4878ff0b972038abeea335b0cf72547b01633 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 20 Nov 2024 17:56:38 +0100 Subject: [PATCH] Fix DataFusionError use in schema_err macro (#13488) Use declaring-crate-relative references so that macro use place does not need to import symbols it doesn't use. --- datafusion/common/src/column.rs | 2 +- datafusion/common/src/error.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datafusion/common/src/column.rs b/datafusion/common/src/column.rs index d855198fa7c6..c47ed2815906 100644 --- a/datafusion/common/src/column.rs +++ b/datafusion/common/src/column.rs @@ -21,7 +21,7 @@ use arrow_schema::{Field, FieldRef}; use crate::error::_schema_err; use crate::utils::{parse_identifiers_normalized, quote_identifier}; -use crate::{DFSchema, DataFusionError, Result, SchemaError, TableReference}; +use crate::{DFSchema, Result, SchemaError, TableReference}; use std::collections::HashSet; use std::convert::Infallible; use std::fmt; diff --git a/datafusion/common/src/error.rs b/datafusion/common/src/error.rs index 05988d6c6da4..4fac7298c455 100644 --- a/datafusion/common/src/error.rs +++ b/datafusion/common/src/error.rs @@ -598,9 +598,9 @@ macro_rules! arrow_err { #[macro_export] macro_rules! schema_datafusion_err { ($ERR:expr) => { - DataFusionError::SchemaError( + $crate::error::DataFusionError::SchemaError( $ERR, - Box::new(Some(DataFusionError::get_back_trace())), + Box::new(Some($crate::error::DataFusionError::get_back_trace())), ) }; } @@ -609,9 +609,9 @@ macro_rules! schema_datafusion_err { #[macro_export] macro_rules! schema_err { ($ERR:expr) => { - Err(DataFusionError::SchemaError( + Err($crate::error::DataFusionError::SchemaError( $ERR, - Box::new(Some(DataFusionError::get_back_trace())), + Box::new(Some($crate::error::DataFusionError::get_back_trace())), )) }; }