Skip to content

Commit ddf49c7

Browse files
chore: Format examples in doc strings - execution (#18339)
## 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-execution -- --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.
1 parent e9431fc commit ddf49c7

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

datafusion/execution/src/config.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ use datafusion_common::{
4444
/// shorthand for setting `datafusion.execution.batch_size`.
4545
///
4646
/// ```
47-
/// use datafusion_execution::config::SessionConfig;
4847
/// use datafusion_common::ScalarValue;
48+
/// use datafusion_execution::config::SessionConfig;
4949
///
5050
/// let config = SessionConfig::new()
51-
/// .set("datafusion.execution.batch_size", &ScalarValue::UInt64(Some(1234)))
52-
/// .set_bool("datafusion.execution.parquet.pushdown_filters", true);
51+
/// .set(
52+
/// "datafusion.execution.batch_size",
53+
/// &ScalarValue::UInt64(Some(1234)),
54+
/// )
55+
/// .set_bool("datafusion.execution.parquet.pushdown_filters", true);
5356
///
5457
/// assert_eq!(config.batch_size(), 1234);
5558
/// assert_eq!(config.options().execution.batch_size, 1234);
@@ -502,8 +505,8 @@ impl SessionConfig {
502505
///
503506
/// # Example
504507
/// ```
505-
/// use std::sync::Arc;
506508
/// use datafusion_execution::config::SessionConfig;
509+
/// use std::sync::Arc;
507510
///
508511
/// // application-specific extension types
509512
/// struct Ext1(u8);
@@ -545,8 +548,8 @@ impl SessionConfig {
545548
///
546549
/// # Example
547550
/// ```
548-
/// use std::sync::Arc;
549551
/// use datafusion_execution::config::SessionConfig;
552+
/// use std::sync::Arc;
550553
///
551554
/// // application-specific extension types
552555
/// struct Ext1(u8);

datafusion/execution/src/memory_pool/pool.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,10 @@ impl<I: MemoryPool> TrackConsumersPool<I> {
346346
/// # Example
347347
///
348348
/// ```rust
349+
/// use datafusion_execution::memory_pool::{
350+
/// FairSpillPool, GreedyMemoryPool, TrackConsumersPool,
351+
/// };
349352
/// use std::num::NonZeroUsize;
350-
/// use datafusion_execution::memory_pool::{TrackConsumersPool, GreedyMemoryPool, FairSpillPool};
351353
///
352354
/// // Create with a greedy pool backend, reporting top 3 consumers in error messages
353355
/// let tracked_greedy = TrackConsumersPool::new(

datafusion/execution/src/runtime_env.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ use url::Url;
6767
/// // restrict to using at most 100MB of memory
6868
/// let pool_size = 100 * 1024 * 1024;
6969
/// let runtime_env = RuntimeEnvBuilder::new()
70-
/// .with_memory_pool(Arc::new(GreedyMemoryPool::new(pool_size)))
71-
/// .build()
72-
/// .unwrap();
70+
/// .with_memory_pool(Arc::new(GreedyMemoryPool::new(pool_size)))
71+
/// .build()
72+
/// .unwrap();
7373
/// ```
7474
pub struct RuntimeEnv {
7575
/// Runtime memory management

0 commit comments

Comments
 (0)