Skip to content

Commit 175ad7f

Browse files
timsaucerclaude
andcommitted
style: freeze the resolved-catalogs carrier
Nothing mutates it between resolve and commit, so there is no reason to pay for the runtime borrow flag a mutable pyclass carries — the same reasoning that froze PhysicalOptimizerRules and ResolvedTables. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 7f47d7f commit 175ad7f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

crates/core/src/context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,8 +1927,9 @@ struct ResolvedTable {
19271927

19281928
/// Catalog providers imported for a `with_extensions` call.
19291929
///
1930-
/// Opaque to Python, like [`PyResolvedTables`] and [`PyPhysicalOptimizerRules`].
1931-
#[pyclass(name = "ResolvedCatalogs", module = "datafusion._internal")]
1930+
/// Opaque to Python, like [`PyResolvedTables`] and [`PyPhysicalOptimizerRules`],
1931+
/// and `frozen` for the same reason as both: the commit only reads.
1932+
#[pyclass(frozen, name = "ResolvedCatalogs", module = "datafusion._internal")]
19321933
pub struct PyResolvedCatalogs {
19331934
catalogs: Vec<(String, Arc<dyn CatalogProvider>)>,
19341935
}

0 commit comments

Comments
 (0)