Skip to content

Commit afd2cdd

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 2567023 commit afd2cdd

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
@@ -1980,8 +1980,9 @@ struct ResolvedTable {
19801980

19811981
/// Catalog providers imported for a `with_extensions` call.
19821982
///
1983-
/// Opaque to Python, like [`PyResolvedTables`] and [`PyPhysicalOptimizerRules`].
1984-
#[pyclass(name = "ResolvedCatalogs", module = "datafusion._internal")]
1983+
/// Opaque to Python, like [`PyResolvedTables`] and [`PyPhysicalOptimizerRules`],
1984+
/// and `frozen` for the same reason as both: the commit only reads.
1985+
#[pyclass(frozen, name = "ResolvedCatalogs", module = "datafusion._internal")]
19851986
pub struct PyResolvedCatalogs {
19861987
catalogs: Vec<(String, Arc<dyn CatalogProvider>)>,
19871988
}

0 commit comments

Comments
 (0)