From 4bc78ea8c37f909fe53f00e0dad787b205bc6c5e Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 1 Dec 2026 15:13:29 -0500 Subject: [PATCH] docs: Link deprecated SchemaAdapter APIs to the 52.0.0 upgrade guide Co-Authored-By: Claude Fable 5.2 --- datafusion/catalog-listing/src/config.rs | 6 ++- datafusion/catalog-listing/src/table.rs | 12 +++-- datafusion/datasource/src/file.rs | 14 +++--- datafusion/datasource/src/schema_adapter.rs | 50 +++++++++++++-------- 4 files changed, 53 insertions(+), 29 deletions(-) diff --git a/datafusion/catalog-listing/src/config.rs b/datafusion/catalog-listing/src/config.rs index ede1894b275cc..26bc4fd2b5f1b 100644 --- a/datafusion/catalog-listing/src/config.rs +++ b/datafusion/catalog-listing/src/config.rs @@ -292,12 +292,14 @@ impl ListingTableConfig { /// Deprecated: Set the [`SchemaAdapterFactory`] for the [`crate::ListingTable`] /// /// `SchemaAdapterFactory` has been removed. Use [`Self::with_expr_adapter_factory`] - /// and `PhysicalExprAdapterFactory` instead. See `upgrading.md` for more details. + /// and `PhysicalExprAdapterFactory` instead. See the [52.0.0 upgrade guide] for more details. + /// + /// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// This method is a no-op and returns `self` unchanged. #[deprecated( since = "52.0.0", - note = "SchemaAdapterFactory has been removed. Use with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapterFactory has been removed. Use with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] #[expect(deprecated)] pub fn with_schema_adapter_factory( diff --git a/datafusion/catalog-listing/src/table.rs b/datafusion/catalog-listing/src/table.rs index 05e3c6c9d1674..ca70a16fdf917 100644 --- a/datafusion/catalog-listing/src/table.rs +++ b/datafusion/catalog-listing/src/table.rs @@ -336,12 +336,14 @@ impl ListingTable { /// Deprecated: Set the [`SchemaAdapterFactory`] for this [`ListingTable`] /// /// `SchemaAdapterFactory` has been removed. Use [`ListingTableConfig::with_expr_adapter_factory`] - /// and `PhysicalExprAdapterFactory` instead. See `upgrading.md` for more details. + /// and `PhysicalExprAdapterFactory` instead. See the [52.0.0 upgrade guide] for more details. + /// + /// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// This method is a no-op and returns `self` unchanged. #[deprecated( since = "52.0.0", - note = "SchemaAdapterFactory has been removed. Use ListingTableConfig::with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapterFactory has been removed. Use ListingTableConfig::with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] #[expect(deprecated)] pub fn with_schema_adapter_factory( @@ -369,12 +371,14 @@ impl ListingTable { /// Deprecated: Returns the [`SchemaAdapterFactory`] used by this [`ListingTable`]. /// /// `SchemaAdapterFactory` has been removed. Use `PhysicalExprAdapterFactory` instead. - /// See `upgrading.md` for more details. + /// See the [52.0.0 upgrade guide] for more details. + /// + /// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// Always returns `None`. #[deprecated( since = "52.0.0", - note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] #[expect(deprecated)] pub fn schema_adapter_factory(&self) -> Option> { diff --git a/datafusion/datasource/src/file.rs b/datafusion/datasource/src/file.rs index 1e80a97668860..39e765a658068 100644 --- a/datafusion/datasource/src/file.rs +++ b/datafusion/datasource/src/file.rs @@ -340,10 +340,12 @@ pub trait FileSource: Any + Send + Sync { /// Deprecated: Set optional schema adapter factory. /// /// `SchemaAdapterFactory` has been removed. Use `PhysicalExprAdapterFactory` instead. - /// See `upgrading.md` for more details. + /// See the [52.0.0 upgrade guide] for more details. + /// + /// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed #[deprecated( since = "53.0.0", - note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] #[expect(deprecated)] fn with_schema_adapter_factory( @@ -351,17 +353,19 @@ pub trait FileSource: Any + Send + Sync { _factory: Arc, ) -> Result> { not_impl_err!( - "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" ) } /// Deprecated: Returns the current schema adapter factory if set. /// /// `SchemaAdapterFactory` has been removed. Use `PhysicalExprAdapterFactory` instead. - /// See `upgrading.md` for more details. + /// See the [52.0.0 upgrade guide] for more details. + /// + /// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed #[deprecated( since = "53.0.0", - note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] #[expect(deprecated)] fn schema_adapter_factory(&self) -> Option> { diff --git a/datafusion/datasource/src/schema_adapter.rs b/datafusion/datasource/src/schema_adapter.rs index 1d739daa3d2a9..b65bf33ce800b 100644 --- a/datafusion/datasource/src/schema_adapter.rs +++ b/datafusion/datasource/src/schema_adapter.rs @@ -4,7 +4,9 @@ //! Deprecated: [`SchemaAdapter`] and [`SchemaAdapterFactory`] have been removed. //! -//! Use [`PhysicalExprAdapterFactory`] instead. See `upgrading.md` for more details. +//! Use [`PhysicalExprAdapterFactory`] instead. See the [52.0.0 upgrade guide] for more details. +//! +//! [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed //! //! [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory @@ -20,12 +22,14 @@ use std::sync::Arc; /// Deprecated: Function type for casting columns. /// /// This type has been removed. Use [`PhysicalExprAdapterFactory`] instead. -/// See `upgrading.md` for more details. +/// See the [52.0.0 upgrade guide] for more details. +/// +/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory #[deprecated( since = "52.0.0", - note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] pub type CastColumnFn = dyn Fn(&ArrayRef, &Field, &arrow::compute::CastOptions) -> Result + Send @@ -34,12 +38,14 @@ pub type CastColumnFn = dyn Fn(&ArrayRef, &Field, &arrow::compute::CastOptions) /// Deprecated: Factory for creating [`SchemaAdapter`]. /// /// This trait has been removed. Use [`PhysicalExprAdapterFactory`] instead. -/// See `upgrading.md` for more details. +/// See the [52.0.0 upgrade guide] for more details. +/// +/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory #[deprecated( since = "52.0.0", - note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] pub trait SchemaAdapterFactory: Debug + Send + Sync + 'static { /// Create a [`SchemaAdapter`] @@ -61,12 +67,14 @@ pub trait SchemaAdapterFactory: Debug + Send + Sync + 'static { /// Deprecated: Creates [`SchemaMapper`]s to map file-level [`RecordBatch`]es to a table schema. /// /// This trait has been removed. Use [`PhysicalExprAdapterFactory`] instead. -/// See `upgrading.md` for more details. +/// See the [52.0.0 upgrade guide] for more details. +/// +/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory #[deprecated( since = "52.0.0", - note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] pub trait SchemaAdapter: Send + Sync { /// Map a column index in the table schema to a column index in a particular file schema. @@ -82,12 +90,14 @@ pub trait SchemaAdapter: Send + Sync { /// Deprecated: Maps columns from a specific file schema to the table schema. /// /// This trait has been removed. Use [`PhysicalExprAdapterFactory`] instead. -/// See `upgrading.md` for more details. +/// See the [52.0.0 upgrade guide] for more details. +/// +/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory #[deprecated( since = "52.0.0", - note = "SchemaMapper has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaMapper has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] pub trait SchemaMapper: Debug + Send + Sync { /// Adapts a `RecordBatch` to match the `table_schema`. @@ -110,7 +120,9 @@ pub trait SchemaMapper: Debug + Send + Sync { /// Use [`BatchAdapter`] if you want to map a stream of [`RecordBatch`]es /// between one schema and another, i.e. if you were calling [`SchemaMapper::map_batch`] manually. /// -/// See `upgrading.md` for more details. +/// See the [52.0.0 upgrade guide] for more details. +/// +/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory /// [`FileScanConfigBuilder`]: crate::file_scan_config::FileScanConfigBuilder @@ -118,7 +130,7 @@ pub trait SchemaMapper: Debug + Send + Sync { /// [`BatchAdapter`]: datafusion_physical_expr_adapter::BatchAdapter #[deprecated( since = "52.0.0", - note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] #[derive(Clone, Debug, Default)] pub struct DefaultSchemaAdapterFactory; @@ -139,12 +151,12 @@ impl DefaultSchemaAdapterFactory { /// Deprecated: Create a new factory for mapping batches from a file schema to a table schema. #[deprecated( since = "52.0.0", - note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] pub fn from_schema(table_schema: SchemaRef) -> Box { // Note: this method did not return an error thus the errors are raised from the returned adapter warn!( - "DefaultSchemaAdapterFactory::from_schema is deprecated. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + "DefaultSchemaAdapterFactory::from_schema is deprecated. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" ); Box::new(DeprecatedSchemaAdapter { _projected_table_schema: table_schema, @@ -168,7 +180,7 @@ impl SchemaAdapter for DeprecatedSchemaAdapter { ) -> Result<(Arc, Vec)> { not_impl_err!( "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. \ - See upgrading.md for more details." + See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" ) } } @@ -183,7 +195,9 @@ impl SchemaAdapter for DeprecatedSchemaAdapter { /// Use [`BatchAdapter`] if you want to map a stream of [`RecordBatch`]es /// between one schema and another, i.e. if you were calling [`SchemaMapper::map_batch`] manually. /// -/// See `upgrading.md` for more details. +/// See the [52.0.0 upgrade guide] for more details. +/// +/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed /// /// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory /// [`FileScanConfigBuilder`]: crate::file_scan_config::FileScanConfigBuilder @@ -191,7 +205,7 @@ impl SchemaAdapter for DeprecatedSchemaAdapter { /// [`BatchAdapter`]: datafusion_physical_expr_adapter::BatchAdapter #[deprecated( since = "52.0.0", - note = "SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details." + note = "SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" )] #[derive(Debug)] pub struct SchemaMapping { @@ -203,7 +217,7 @@ impl SchemaMapper for SchemaMapping { fn map_batch(&self, _batch: RecordBatch) -> Result { not_impl_err!( "SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. \ - See upgrading.md for more details." + See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" ) } @@ -213,7 +227,7 @@ impl SchemaMapper for SchemaMapping { ) -> Result> { not_impl_err!( "SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. \ - See upgrading.md for more details." + See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed" ) } }