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

Random quotes on numbers when serializing to json #313

Closed
captain-yoshi opened this issue Sep 28, 2022 · 2 comments · Fixed by #314
Closed

Random quotes on numbers when serializing to json #313

captain-yoshi opened this issue Sep 28, 2022 · 2 comments · Fixed by #314

Comments

@captain-yoshi
Copy link
Contributor

captain-yoshi commented Sep 28, 2022

I generate a certain YAML file which seems alright. When converting this file to JSON, some numbers are actually quoted which should not ! You can get the yaml and json datasets here.

Examples of random quotes poping up :

"WEIRD": ["0.99356698989868164", 1.0605627298355103],
"OK":    [0, 0, 0],
"WEIRD": ["0.0064908224157989025", "0.0064917667768895626", "0.0064947893843054771"],
"OK":    [6.6227097511291504, 6.8674740791320801, 7.0403199195861816, 7.5792555809020996, 7.9916787147521973, 8.136042594909668, 8.5505847930908203, 8.701807975769043, 8.926518440246582, 8.9484291076660156, 9.0740194320678711, 9.3788108825683594, 9.406926155090332,
"WEIRD": ["0.91054189205169678", "0.98725020885467529", 1.070807933807373],
"REALLY WEIRD": 
[
  [1.5158847570419312, 1.6361792087554932],
  [1.0741721391677856, 1.1791903972625732],
  [1.4423576593399048, 1.7063977718353271],
  [1.1791903972625732],
  [1.1493504047393799, 1.1791903972625732],
  [1.1791903972625732, 1.3334760665893555],
  [1.0655292272567749, 1.4933452606201172],
  [1.0712906122207642, 1.1791903972625732],
  [1.1791903972625732, 1.830910325050354],
  ["0.13215841352939606", 1.4161584377288818],
  [1.1791903972625732, 1.5179581642150879],
  [1.1791903972625732, 1.2864601612091064],
  [1.1791903972625732, 1.6865267753601074],
  [1.1791903972625732, 1.2192368507385254],
  [1.1130030155181885, 1.5196701288223267],
  [1.0621790885925293, 1.1791903972625732]
]
@biojppm
Copy link
Owner

biojppm commented Sep 28, 2022

apparently the problem is with 0-leading numbers... hold on while I investigate

@biojppm
Copy link
Owner

biojppm commented Sep 28, 2022

Got it. This is a regression from the fix to #291, done in fbec340. It is quoting numbers like 04, but it should not quote numbers like 0.4.

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.

2 participants