Skip to content

Commit 3fd56d0

Browse files
author
B Vadlamani
committed
deprecate_paste_crate
1 parent 61adc69 commit 3fd56d0

13 files changed

Lines changed: 93 additions & 67 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ parquet = { version = "58.0.0", default-features = false, features = [
173173
"async",
174174
"object_store",
175175
] }
176-
paste = "1.0.15"
177176
pbjson = { version = "0.9.0" }
178177
pbjson-types = "0.9"
179178
# Should match arrow-flight's version of prost.

datafusion/common/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ libc = "0.2.180"
8181
log = { workspace = true }
8282
object_store = { workspace = true, optional = true }
8383
parquet = { workspace = true, optional = true, default-features = true }
84-
paste = { workspace = true }
8584
recursive = { workspace = true, optional = true }
8685
sqlparser = { workspace = true, optional = true }
8786
tokio = { workspace = true }

datafusion/common/src/error.rs

Lines changed: 93 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -903,76 +903,123 @@ macro_rules! assert_ne_or_internal_err {
903903
/// plan_err!("Error {val:?}")
904904
///
905905
/// `NAME_ERR` - macro name for wrapping Err(DataFusionError::*)
906+
/// `PREFIXED_NAME_ERR` - underscore-prefixed alias for NAME_ERR (e.g., _plan_err)
906907
/// `NAME_DF_ERR` - macro name for wrapping DataFusionError::*. Needed to keep backtrace opportunity
907908
/// in construction where DataFusionError::* used directly, like `map_err`, `ok_or_else`, etc
909+
/// `PREFIXED_NAME_DF_ERR` - underscore-prefixed alias for NAME_DF_ERR (e.g., _plan_datafusion_err)
908910
macro_rules! make_error {
909-
($NAME_ERR:ident, $NAME_DF_ERR: ident, $ERR:ident) => { make_error!(@inner ($), $NAME_ERR, $NAME_DF_ERR, $ERR); };
910-
(@inner ($d:tt), $NAME_ERR:ident, $NAME_DF_ERR:ident, $ERR:ident) => {
911-
::paste::paste!{
912-
/// Macro wraps `$ERR` to add backtrace feature
913-
#[macro_export]
914-
macro_rules! $NAME_DF_ERR {
915-
($d($d args:expr),* $d(; diagnostic=$d DIAG:expr)?) => {{
916-
let err =$crate::DataFusionError::$ERR(
917-
::std::format!(
918-
"{}{}",
919-
::std::format!($d($d args),*),
920-
$crate::DataFusionError::get_back_trace(),
921-
).into()
922-
);
923-
$d (
924-
let err = err.with_diagnostic($d DIAG);
925-
)?
926-
err
927-
}
928-
}
911+
($NAME_ERR:ident, $PREFIXED_NAME_ERR:ident, $NAME_DF_ERR:ident, $PREFIXED_NAME_DF_ERR:ident, $ERR:ident) => {
912+
make_error!(@inner ($), $NAME_ERR, $PREFIXED_NAME_ERR, $NAME_DF_ERR, $PREFIXED_NAME_DF_ERR, $ERR);
913+
};
914+
(@inner ($d:tt), $NAME_ERR:ident, $PREFIXED_NAME_ERR:ident, $NAME_DF_ERR:ident, $PREFIXED_NAME_DF_ERR:ident, $ERR:ident) => {
915+
/// Macro wraps `$ERR` to add backtrace feature
916+
#[macro_export]
917+
macro_rules! $NAME_DF_ERR {
918+
($d($d args:expr),* $d(; diagnostic=$d DIAG:expr)?) => {{
919+
let err = $crate::DataFusionError::$ERR(
920+
::std::format!(
921+
"{}{}",
922+
::std::format!($d($d args),*),
923+
$crate::DataFusionError::get_back_trace(),
924+
).into()
925+
);
926+
$d (
927+
let err = err.with_diagnostic($d DIAG);
928+
)?
929+
err
930+
}}
929931
}
930932

931-
/// Macro wraps Err(`$ERR`) to add backtrace feature
932-
#[macro_export]
933-
macro_rules! $NAME_ERR {
934-
($d($d args:expr),* $d(; diagnostic = $d DIAG:expr)?) => {{
935-
let err = $crate::[<_ $NAME_DF_ERR>]!($d($d args),*);
936-
$d (
937-
let err = err.with_diagnostic($d DIAG);
938-
)?
939-
Err(err)
940-
941-
}}
942-
}
943-
944-
945-
#[doc(hidden)]
946-
pub use $NAME_ERR as [<_ $NAME_ERR>];
947-
#[doc(hidden)]
948-
pub use $NAME_DF_ERR as [<_ $NAME_DF_ERR>];
933+
/// Macro wraps Err(`$ERR`) to add backtrace feature
934+
#[macro_export]
935+
macro_rules! $NAME_ERR {
936+
($d($d args:expr),* $d(; diagnostic = $d DIAG:expr)?) => {{
937+
let err = $crate::$PREFIXED_NAME_DF_ERR!($d($d args),*);
938+
$d (
939+
let err = err.with_diagnostic($d DIAG);
940+
)?
941+
Err(err)
942+
}}
949943
}
944+
945+
#[doc(hidden)]
946+
pub use $NAME_ERR as $PREFIXED_NAME_ERR;
947+
#[doc(hidden)]
948+
pub use $NAME_DF_ERR as $PREFIXED_NAME_DF_ERR;
950949
};
951950
}
952951

953952
// Exposes a macro to create `DataFusionError::Plan` with optional backtrace
954-
make_error!(plan_err, plan_datafusion_err, Plan);
953+
make_error!(
954+
plan_err,
955+
_plan_err,
956+
plan_datafusion_err,
957+
_plan_datafusion_err,
958+
Plan
959+
);
955960

956961
// Exposes a macro to create `DataFusionError::Internal` with optional backtrace
957-
make_error!(internal_err, internal_datafusion_err, Internal);
962+
make_error!(
963+
internal_err,
964+
_internal_err,
965+
internal_datafusion_err,
966+
_internal_datafusion_err,
967+
Internal
968+
);
958969

959970
// Exposes a macro to create `DataFusionError::NotImplemented` with optional backtrace
960-
make_error!(not_impl_err, not_impl_datafusion_err, NotImplemented);
971+
make_error!(
972+
not_impl_err,
973+
_not_impl_err,
974+
not_impl_datafusion_err,
975+
_not_impl_datafusion_err,
976+
NotImplemented
977+
);
961978

962979
// Exposes a macro to create `DataFusionError::Execution` with optional backtrace
963-
make_error!(exec_err, exec_datafusion_err, Execution);
980+
make_error!(
981+
exec_err,
982+
_exec_err,
983+
exec_datafusion_err,
984+
_exec_datafusion_err,
985+
Execution
986+
);
964987

965988
// Exposes a macro to create `DataFusionError::Configuration` with optional backtrace
966-
make_error!(config_err, config_datafusion_err, Configuration);
989+
make_error!(
990+
config_err,
991+
_config_err,
992+
config_datafusion_err,
993+
_config_datafusion_err,
994+
Configuration
995+
);
967996

968997
// Exposes a macro to create `DataFusionError::Substrait` with optional backtrace
969-
make_error!(substrait_err, substrait_datafusion_err, Substrait);
998+
make_error!(
999+
substrait_err,
1000+
_substrait_err,
1001+
substrait_datafusion_err,
1002+
_substrait_datafusion_err,
1003+
Substrait
1004+
);
9701005

9711006
// Exposes a macro to create `DataFusionError::ResourcesExhausted` with optional backtrace
972-
make_error!(resources_err, resources_datafusion_err, ResourcesExhausted);
1007+
make_error!(
1008+
resources_err,
1009+
_resources_err,
1010+
resources_datafusion_err,
1011+
_resources_datafusion_err,
1012+
ResourcesExhausted
1013+
);
9731014

9741015
// Exposes a macro to create `DataFusionError::Ffi` with optional backtrace
975-
make_error!(ffi_err, ffi_datafusion_err, Ffi);
1016+
make_error!(
1017+
ffi_err,
1018+
_ffi_err,
1019+
ffi_datafusion_err,
1020+
_ffi_datafusion_err,
1021+
Ffi
1022+
);
9761023

9771024
// Exposes a macro to create `DataFusionError::SQL` with optional backtrace
9781025
#[macro_export]

datafusion/core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ bytes = { workspace = true }
172172
env_logger = { workspace = true }
173173
glob = { workspace = true }
174174
insta = { workspace = true }
175-
paste = { workspace = true }
176175
pretty_assertions = "1.0"
177176
rand = { workspace = true, features = ["small_rng"] }
178177
rand_distr = "0.5"

datafusion/expr-common/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ arrow = { workspace = true }
4545
datafusion-common = { workspace = true }
4646
indexmap = { workspace = true }
4747
itertools = { workspace = true }
48-
paste = { workspace = true }
4948

5049
[dev-dependencies]
5150
insta = { workspace = true }

datafusion/expr/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ datafusion-functions-window-common = { workspace = true }
5757
datafusion-physical-expr-common = { workspace = true }
5858
indexmap = { workspace = true }
5959
itertools = { workspace = true }
60-
paste = { workspace = true }
6160
recursive = { workspace = true, optional = true }
6261
serde_json = { workspace = true }
6362
sqlparser = { workspace = true, optional = true }

datafusion/functions-aggregate/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ datafusion-physical-expr-common = { workspace = true }
5454
half = { workspace = true }
5555
log = { workspace = true }
5656
num-traits = { workspace = true }
57-
paste = { workspace = true }
5857

5958
[dev-dependencies]
6059
arrow = { workspace = true, features = ["test_utils"] }

datafusion/functions-nested/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ hashbrown = { workspace = true }
6161
itertools = { workspace = true, features = ["use_std"] }
6262
itoa = { workspace = true }
6363
log = { workspace = true }
64-
paste = { workspace = true }
6564

6665
[dev-dependencies]
6766
criterion = { workspace = true, features = ["async_tokio"] }

datafusion/functions-table/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ datafusion-common = { workspace = true }
4848
datafusion-expr = { workspace = true }
4949
datafusion-physical-plan = { workspace = true }
5050
parking_lot = { workspace = true }
51-
paste = { workspace = true }
5251

5352
[dev-dependencies]
5453
arrow = { workspace = true, features = ["test_utils"] }

0 commit comments

Comments
 (0)