This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 80848f2a0a Fix #11692: Improve doc comments within macros (#11694)
80848f2a0a is described below
commit 80848f2a0a08b61be441ac37a00073d4447e9603
Author: Alexander Rafferty <[email protected]>
AuthorDate: Fri Aug 2 20:35:04 2024 +1000
Fix #11692: Improve doc comments within macros (#11694)
* Fix #11692: Improve doc comments within macros
* Fix doc errors
---------
Co-authored-by: Andrew Lamb <[email protected]>
---
datafusion/expr/src/test/function_stub.rs | 6 ++----
datafusion/functions-aggregate/src/macros.rs | 6 ++----
datafusion/functions-nested/src/macros.rs | 6 +++---
datafusion/functions/src/macros.rs | 5 ++---
4 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/datafusion/expr/src/test/function_stub.rs
b/datafusion/expr/src/test/function_stub.rs
index 14a6522ebe..3e0760b5c0 100644
--- a/datafusion/expr/src/test/function_stub.rs
+++ b/datafusion/expr/src/test/function_stub.rs
@@ -44,11 +44,9 @@ macro_rules! create_func {
/// named STATIC_$(UDAF). For example `STATIC_FirstValue`
#[allow(non_upper_case_globals)]
static [< STATIC_ $UDAF >]:
std::sync::OnceLock<std::sync::Arc<crate::AggregateUDF>> =
- std::sync::OnceLock::new();
+ std::sync::OnceLock::new();
- /// AggregateFunction that returns a [AggregateUDF] for [$UDAF]
- ///
- /// [AggregateUDF]: crate::AggregateUDF
+ #[doc = concat!("AggregateFunction that returns a
[AggregateUDF](crate::AggregateUDF) for [`", stringify!($UDAF), "`]")]
pub fn $AGGREGATE_UDF_FN() -> std::sync::Arc<crate::AggregateUDF> {
[< STATIC_ $UDAF >]
.get_or_init(|| {
diff --git a/datafusion/functions-aggregate/src/macros.rs
b/datafusion/functions-aggregate/src/macros.rs
index cae72cf352..573b9fd5bd 100644
--- a/datafusion/functions-aggregate/src/macros.rs
+++ b/datafusion/functions-aggregate/src/macros.rs
@@ -86,11 +86,9 @@ macro_rules! create_func {
/// named STATIC_$(UDAF). For example `STATIC_FirstValue`
#[allow(non_upper_case_globals)]
static [< STATIC_ $UDAF >]:
std::sync::OnceLock<std::sync::Arc<datafusion_expr::AggregateUDF>> =
- std::sync::OnceLock::new();
+ std::sync::OnceLock::new();
- /// AggregateFunction that returns a [AggregateUDF] for [$UDAF]
- ///
- /// [AggregateUDF]: datafusion_expr::AggregateUDF
+ #[doc = concat!("AggregateFunction that returns a
[`AggregateUDF`](datafusion_expr::AggregateUDF) for [`", stringify!($UDAF),
"`]")]
pub fn $AGGREGATE_UDF_FN() ->
std::sync::Arc<datafusion_expr::AggregateUDF> {
[< STATIC_ $UDAF >]
.get_or_init(|| {
diff --git a/datafusion/functions-nested/src/macros.rs
b/datafusion/functions-nested/src/macros.rs
index a6e0c2ee62..00247f39ac 100644
--- a/datafusion/functions-nested/src/macros.rs
+++ b/datafusion/functions-nested/src/macros.rs
@@ -90,9 +90,9 @@ macro_rules! create_func {
#[allow(non_upper_case_globals)]
static [< STATIC_ $UDF >]:
std::sync::OnceLock<std::sync::Arc<datafusion_expr::ScalarUDF>> =
std::sync::OnceLock::new();
- /// ScalarFunction that returns a [`ScalarUDF`] for [`$UDF`]
- ///
- /// [`ScalarUDF`]: datafusion_expr::ScalarUDF
+
+ #[doc = concat!("ScalarFunction that returns a
[`ScalarUDF`](datafusion_expr::ScalarUDF) for ")]
+ #[doc = stringify!($UDF)]
pub fn $SCALAR_UDF_FN() ->
std::sync::Arc<datafusion_expr::ScalarUDF> {
[< STATIC_ $UDF >]
.get_or_init(|| {
diff --git a/datafusion/functions/src/macros.rs
b/datafusion/functions/src/macros.rs
index e26c94e1bb..484afb57f7 100644
--- a/datafusion/functions/src/macros.rs
+++ b/datafusion/functions/src/macros.rs
@@ -75,9 +75,8 @@ macro_rules! make_udf_function {
static $GNAME:
std::sync::OnceLock<std::sync::Arc<datafusion_expr::ScalarUDF>> =
std::sync::OnceLock::new();
- /// Return a [`ScalarUDF`] for [`$UDF`]
- ///
- /// [`ScalarUDF`]: datafusion_expr::ScalarUDF
+ #[doc = "Return a [`ScalarUDF`](datafusion_expr::ScalarUDF) for "]
+ #[doc = stringify!($UDF)]
pub fn $NAME() -> std::sync::Arc<datafusion_expr::ScalarUDF> {
$GNAME
.get_or_init(|| {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]