Skip to content

LongLiteral.to(FloatType) raises OverflowError instead of returning overflow sentinel #3494

@kevinjqliu

Description

@kevinjqliu

Describe the bug

LongLiteral.to(FloatType) raises OverflowError for integers outside the float range instead of returning FloatAboveMax / FloatBelowMin.

Reproducer

from pyiceberg.expressions import literal
from pyiceberg.types import FloatType

literal(10**39).to(FloatType())
# OverflowError: float too large to pack with f format

Expected behavior

Values above or below FloatType bounds should return the float overflow sentinels, matching DecimalLiteral.to(FloatType) and StringLiteral.to(FloatType).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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