Skip to content

Integer values exceeding the limits of i64 are converted to FloatingPoint #85

@chirizxc

Description

@chirizxc

If an integer exceeds the limits of i64, it is converted to a float:

saphyr/saphyr/src/scalar.rs

Lines 191 to 206 in 001b709

match &*v {
"~" | "null" | "Null" | "NULL" => Self::Null,
"true" | "True" | "TRUE" => Self::Boolean(true),
"false" | "False" | "FALSE" => Self::Boolean(false),
_ => {
if let Ok(integer) = v.parse::<i64>() {
Self::Integer(integer)
} else if let Some(float) = parse_core_schema_fp(&v) {
Self::FloatingPoint(float.into())
} else {
Self::String(v)
}
}
}
}
}

Can we just return an error saying that the number is too large?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions