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

Numeric inference in 3.0.0 appears broken #1221

Open
panesofglass opened this issue Oct 23, 2018 · 4 comments
Open

Numeric inference in 3.0.0 appears broken #1221

panesofglass opened this issue Oct 23, 2018 · 4 comments

Comments

@panesofglass
Copy link
Contributor

panesofglass commented Oct 23, 2018

In FSharp.Data 3.0.0-beta4, inference for a JSON with a numeric array field worked properly. When attempting to upgrade to 3.0.0, however, the inference breaks, and the inferred type is int []. I'm currently working on a repro test case. This is preventing our ability to update to the 3.0.0 release version.

@panesofglass
Copy link
Contributor Author

I suspect this commit may be the culprit, but I'm still looking: 8d05e4b

@atlemann
Copy link

What does your numeric array field look like? After bumping to v3.0, 0.1e1 is inferred as int. To fix it I had to change to 0.1e0 or 0.11e1.

For arrays, make sure all the entries are in exponential format. Maybe that helps.

@panesofglass
Copy link
Contributor Author

I'm figuring out ways to work around this, but I think the general inference should be that, if there's an e or E in the string representation, it should be a float.

@baronfel
Copy link
Contributor

I think we could solve this with some additional information attached to the JsonValue.Float case that let us know if the float value was exponential or not. Then we could use that flag to disallow inferring the sample value as an integer at all.

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

No branches or pull requests

3 participants