Skip to content

Deprecate ExprSchemable::metadata #18930

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

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

fn metadata(&self, schema: &dyn ExprSchema) -> Result<FieldMetadata> {
self.to_field(schema)
.map(|(_, field)| FieldMetadata::from(field.metadata()))
}

Describe the solution you'd like

We should deprecate metadata 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

  1. Add deprecation notice to ExprSchemable::metadata
  2. Add a note / example in the docs for ExprSchemable::to_field that notes how to get Metadata
  3. Update all existing code locations that call ExprSchemable::metadata to use ExprSchemable::to_field instead

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions