This is an automated email from the ASF dual-hosted git repository.
github-bot 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 606dfd236c chore: Format examples in doc strings - catalog listing
(#18335)
606dfd236c is described below
commit 606dfd236ca030e7f45b638b7d8b7edd93442cba
Author: Yu-Chuan Hung <[email protected]>
AuthorDate: Thu Oct 30 03:59:55 2025 +0800
chore: Format examples in doc strings - catalog listing (#18335)
## Which issue does this PR close?
Part of #16915
## Rationale for this change
Format code examples in documentation comments to improve readability
and maintain consistent code style across the codebase. This is part of
a multi-PR effort to format all doc comment examples and eventually
enable CI checks to enforce this formatting.
## What changes are included in this PR?
Run `cargo fmt -p datafusion-catalog-listing -- --config
format_code_in_doc_comments=true`
## Are these changes tested?
No testing needed - this is purely a formatting change with no
functional modifications.
## Are there any user-facing changes?
No - this only affects documentation formatting.
Co-authored-by: Andrew Lamb <[email protected]>
---
datafusion/catalog-listing/src/config.rs | 5 ++---
datafusion/catalog-listing/src/options.rs | 36 +++++++++++--------------------
2 files changed, 14 insertions(+), 27 deletions(-)
diff --git a/datafusion/catalog-listing/src/config.rs
b/datafusion/catalog-listing/src/config.rs
index 90f44de4fd..3370d2ea75 100644
--- a/datafusion/catalog-listing/src/config.rs
+++ b/datafusion/catalog-listing/src/config.rs
@@ -53,7 +53,6 @@ pub enum SchemaSource {
///
/// If not specified, a
[`datafusion_datasource::schema_adapter::DefaultSchemaAdapterFactory`]
/// will be used, which handles basic schema compatibility cases.
-///
#[derive(Debug, Clone, Default)]
pub struct ListingTableConfig {
/// Paths on the `ObjectStore` for creating [`crate::ListingTable`].
@@ -160,8 +159,8 @@ impl ListingTableConfig {
/// .with_file_extension(".parquet")
/// .with_collect_stat(true);
///
- /// let config = ListingTableConfig::new(table_paths)
- /// .with_listing_options(options); // Configure file format and
options
+ /// let config =
ListingTableConfig::new(table_paths).with_listing_options(options);
+ /// // Configure file format and options
/// ```
pub fn with_listing_options(self, listing_options: ListingOptions) -> Self
{
// Note: This method properly sets options, but be aware that
downstream
diff --git a/datafusion/catalog-listing/src/options.rs
b/datafusion/catalog-listing/src/options.rs
index 3cbf3573e9..7da8005f90 100644
--- a/datafusion/catalog-listing/src/options.rs
+++ b/datafusion/catalog-listing/src/options.rs
@@ -100,10 +100,8 @@ impl ListingOptions {
/// # use datafusion_catalog_listing::ListingOptions;
/// # use datafusion_datasource_parquet::file_format::ParquetFormat;
///
- /// let listing_options = ListingOptions::new(Arc::new(
- /// ParquetFormat::default()
- /// ))
- /// .with_file_extension(".parquet");
+ /// let listing_options =
ListingOptions::new(Arc::new(ParquetFormat::default()))
+ /// .with_file_extension(".parquet");
///
/// assert_eq!(listing_options.file_extension, ".parquet");
/// ```
@@ -123,10 +121,8 @@ impl ListingOptions {
/// # use datafusion_datasource_parquet::file_format::ParquetFormat;
///
/// let extension = Some(".parquet");
- /// let listing_options = ListingOptions::new(Arc::new(
- /// ParquetFormat::default()
- /// ))
- /// .with_file_extension_opt(extension);
+ /// let listing_options =
ListingOptions::new(Arc::new(ParquetFormat::default()))
+ /// .with_file_extension_opt(extension);
///
/// assert_eq!(listing_options.file_extension, ".parquet");
/// ```
@@ -216,10 +212,8 @@ impl ListingOptions {
/// # use datafusion_catalog_listing::ListingOptions;
/// # use datafusion_datasource_parquet::file_format::ParquetFormat;
///
- /// let listing_options = ListingOptions::new(Arc::new(
- /// ParquetFormat::default()
- /// ))
- /// .with_collect_stat(true);
+ /// let listing_options =
+ ///
ListingOptions::new(Arc::new(ParquetFormat::default())).with_collect_stat(true);
///
/// assert_eq!(listing_options.collect_stat, true);
/// ```
@@ -235,10 +229,8 @@ impl ListingOptions {
/// # use datafusion_catalog_listing::ListingOptions;
/// # use datafusion_datasource_parquet::file_format::ParquetFormat;
///
- /// let listing_options = ListingOptions::new(Arc::new(
- /// ParquetFormat::default()
- /// ))
- /// .with_target_partitions(8);
+ /// let listing_options =
+ ///
ListingOptions::new(Arc::new(ParquetFormat::default())).with_target_partitions(8);
///
/// assert_eq!(listing_options.target_partitions, 8);
/// ```
@@ -255,15 +247,11 @@ impl ListingOptions {
/// # use datafusion_catalog_listing::ListingOptions;
/// # use datafusion_datasource_parquet::file_format::ParquetFormat;
///
- /// // Tell datafusion that the files are sorted by column "a"
- /// let file_sort_order = vec![vec![
- /// col("a").sort(true, true)
- /// ]];
+ /// // Tell datafusion that the files are sorted by column "a"
+ /// let file_sort_order = vec![vec![col("a").sort(true, true)]];
///
- /// let listing_options = ListingOptions::new(Arc::new(
- /// ParquetFormat::default()
- /// ))
- /// .with_file_sort_order(file_sort_order.clone());
+ /// let listing_options =
ListingOptions::new(Arc::new(ParquetFormat::default()))
+ /// .with_file_sort_order(file_sort_order.clone());
///
/// assert_eq!(listing_options.file_sort_order, file_sort_order);
/// ```
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]