Skip to content

Commit

Permalink
Improve deprecation message for MemoryExec (#14322)
Browse files Browse the repository at this point in the history
* Improve deprecation message for `MemoryExec`

* clippy
  • Loading branch information
alamb authored Jan 28, 2025
1 parent 1920771 commit 8d542ec
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion datafusion/physical-plan/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ use datafusion_execution::TaskContext;
use datafusion_physical_expr::EquivalenceProperties;

/// Execution plan for values list based relation (produces constant rows)
#[deprecated(since = "45.0.0", note = "Use `MemoryExec::try_new_as_values` instead")]
///
/// Note this structure is the same as [`MemoryExec`] and is deprecated.
/// Please see the following for alternatives
/// * [`MemoryExec::try_new`]
/// * [`MemoryExec::try_new_from_batches`]
///
/// [`MemoryExec`]: crate::memory::MemoryExec
/// [`MemoryExec::try_new`]: crate::memory::MemoryExec::try_new
/// [`MemoryExec::try_new_from_batches`]: crate::memory::MemoryExec::try_new_from_batches
#[deprecated(since = "45.0.0", note = "Use `MemoryExec` instead")]
#[derive(Debug, Clone)]
pub struct ValuesExec {
/// The schema
Expand All @@ -48,6 +57,7 @@ pub struct ValuesExec {
#[allow(deprecated)]
impl ValuesExec {
/// Create a new values exec from data as expr
#[deprecated(since = "45.0.0", note = "Use `MemoryExec::try_new` instead")]
pub fn try_new(
schema: SchemaRef,
data: Vec<Vec<Arc<dyn PhysicalExpr>>>,
Expand Down Expand Up @@ -101,6 +111,10 @@ impl ValuesExec {
///
/// Errors if any of the batches don't match the provided schema, or if no
/// batches are provided.
#[deprecated(
since = "45.0.0",
note = "Use `MemoryExec::try_new_from_batches` instead"
)]
pub fn try_new_from_batches(
schema: SchemaRef,
batches: Vec<RecordBatch>,
Expand Down

0 comments on commit 8d542ec

Please sign in to comment.