When using interval_day without an explicit precision parameter (e.g., in an extension function's return type derivation), the evaluation fails with an error. The _evaluate function in derivation_expression.py assumes the precision parameter is always present for PrecisionIntervalDayContext, but the Substrait spec allows interval_day to be used without specifying precision.
Steps to Reproduce
Use interval_day (or interval_day?) as a type expression without a precision parameter:
from substrait.derivation_expression import evaluate
evaluate("interval_day") # raises an error
Expected Behavior
interval_day without a precision parameter should evaluate to a valid Type.IntervalDay message (with default/unset precision), similar to how other types handle optional parameters.
Actual Behavior
The evaluation attempts to call _evaluate on None (the missing precision), resulting in an error.
When using interval_day without an explicit precision parameter (e.g., in an extension function's return type derivation), the evaluation fails with an error. The _evaluate function in derivation_expression.py assumes the precision parameter is always present for PrecisionIntervalDayContext, but the Substrait spec allows interval_day to be used without specifying precision.
Steps to Reproduce
Use interval_day (or interval_day?) as a type expression without a precision parameter:
from substrait.derivation_expression import evaluate
evaluate("interval_day") # raises an error
Expected Behavior
interval_day without a precision parameter should evaluate to a valid Type.IntervalDay message (with default/unset precision), similar to how other types handle optional parameters.
Actual Behavior
The evaluation attempts to call _evaluate on None (the missing precision), resulting in an error.