-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
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
datafusion/datafusion/expr/src/expr_schema.rs
Lines 426 to 443 in 4f95e6d
| /// 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
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers