From 1a9da6feef02786dcc75ecc433604cbb45c9e98b Mon Sep 17 00:00:00 2001 From: wiedld Date: Fri, 20 Dec 2024 17:05:15 -0800 Subject: [PATCH] refactor(11770): provide deprecation warning for TryFrom --- datafusion/common/src/file_options/parquet_writer.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/datafusion/common/src/file_options/parquet_writer.rs b/datafusion/common/src/file_options/parquet_writer.rs index a99694d3e07f..33825616866a 100644 --- a/datafusion/common/src/file_options/parquet_writer.rs +++ b/datafusion/common/src/file_options/parquet_writer.rs @@ -59,6 +59,17 @@ impl ParquetWriterOptions { } impl TableParquetOptions { + #[deprecated( + since = "44.0.0", + note = "Please use `TableParquetOptions::into_writer_properties_builder` and `TableParquetOptions::into_writer_properties_builder_with_arrow_schema`" + )] + pub fn try_from(table_opts: &TableParquetOptions) -> Result { + // ParquetWriterOptions will have defaults for the remaining fields (e.g. sorting_columns) + Ok(ParquetWriterOptions { + writer_options: table_opts.into_writer_properties_builder()?.build(), + }) + } + /// Convert the session's [`TableParquetOptions`] into a single write action's [`WriterPropertiesBuilder`]. /// /// The returned [`WriterPropertiesBuilder`] includes customizations applicable per column.