Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: unable to parse scientific notation with + symbol #16

Closed
universalmind303 opened this issue Dec 2, 2022 · 0 comments · Fixed by #17
Closed

Bug: unable to parse scientific notation with + symbol #16

universalmind303 opened this issue Dec 2, 2022 · 0 comments · Fixed by #17

Comments

@universalmind303
Copy link
Contributor

This was first reported in polars. We are using arrow2 to infer the schema for ndjson data types, which looks like it is using this to crate deserialize json in the implementation of arrow2::io::ndjson::read::infer

Expected:

Number is parsed correctly
serde_json will parse as so: {"Value": Number(11000000000.0)}

Actual:

json_deserializer errors out with MissingComa(43) when trying to parse scientific notation with + symbol.

Steps to reproduce

fn main() {
    let mut s = br#"{"Value":1.1e+10}"#.to_vec();
    let v = json_deserializer::parse(&mut s);
    println!("{:?}", v);
}
// Err(MissingComa(43))

Note: the - symbol parses as expected.

fn main() {
    let mut s = br#"{"Value":1.1e-10}"#.to_vec();
    let v = json_deserializer::parse(&mut s);
    println!("{:?}", v);
}
// Ok(Object({"Value": Number(Float([49, 46, 49], [45, 49, 48]))}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant