Skip to content

Clean-up config setter/getter doc comments #25101

Description

@2010YOUY01

Is your feature request related to a problem or challenge?

A configuration option's main documentation should live in the comment on the config definition, since the docs are auto-generated from there: https://datafusion.apache.org/user-guide/configs.html

The setters and getters for a configuration option should simply point to the config field, so the documentation stays centralized.

/// Customize [`target_partitions`]
///
/// [`target_partitions`]: datafusion_common::config::ExecutionOptions::target_partitions
pub fn with_target_partitions(mut self, n: usize) -> Self {
self.options_mut().execution.target_partitions = if n == 0 {
datafusion_common::config::ExecutionOptions::default().target_partitions
} else {
n
};
self
}

However, some config options try to explain it again in the setter/getter:

pub fn with_repartition_aggregations(mut self, enabled: bool) -> Self {

It would be better to keep the setter/getter comments consistent: simply point to the definition.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions