Skip to content

interval_day type without precision parameter causes error in derivation expression evaluation #177

@thgschwind

Description

@thgschwind

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions