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 93278ee
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(&self) -> Result<ParquetWriterOptions> {
// ParquetWriterOptions will have defaults for the remaining fields (e.g. sorting_columns)
Ok(ParquetWriterOptions {
writer_options: self.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 93278ee

Please sign in to comment.