Skip to content

Commit

Permalink
refactor(11770): provide deprecation warning for TryFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedld committed Dec 21, 2024
1 parent 7a6a276 commit 1a9da6f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions datafusion/common/src/file_options/parquet_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
// 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.
Expand Down

0 comments on commit 1a9da6f

Please sign in to comment.