Skip to content

Deprecate ExprSchemable:: data_type_and_nullable #18844

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

ExprSchemable::datatype_and_properties simply calls through to to_field and thus makes the API more complicated for no real gain

/// Returns the datatype and nullability of the expression based on [ExprSchema].
///
/// Note: [`DFSchema`] implements [ExprSchema].
///
/// [`DFSchema`]: datafusion_common::DFSchema
///
/// # Errors
///
/// This function errors when it is not possible to compute its
/// datatype or nullability.
fn data_type_and_nullable(
&self,
schema: &dyn ExprSchema,
) -> Result<(DataType, bool)> {
let field = self.to_field(schema)?.1;
Ok((field.data_type().clone(), field.is_nullable()))
}

Describe the solution you'd like

We should deprecate data_type_and_nullable to encourage people to use to_field directly

The deprecation guidelines are here: https://datafusion.apache.org/contributor-guide/api-health.html#deprecation-guidelines

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions