Skip to content

Commit

Permalink
Fix #11692: Improve doc comments within macros (#11694)
Browse files Browse the repository at this point in the history
* Fix #11692: Improve doc comments within macros

* Fix doc errors

---------

Co-authored-by: Andrew Lamb <[email protected]>
  • Loading branch information
Rafferty97 and alamb authored Aug 2, 2024
1 parent df4e6cc commit 80848f2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
6 changes: 2 additions & 4 deletions datafusion/expr/src/test/function_stub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(|| {
Expand Down
6 changes: 2 additions & 4 deletions datafusion/functions-aggregate/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(|| {
Expand Down
6 changes: 3 additions & 3 deletions datafusion/functions-nested/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(|| {
Expand Down
5 changes: 2 additions & 3 deletions datafusion/functions/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(|| {
Expand Down

0 comments on commit 80848f2

Please sign in to comment.