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

JSON formatter produces invalid JSON file #202

Open
dsiguero opened this issue Jan 25, 2024 · 2 comments
Open

JSON formatter produces invalid JSON file #202

dsiguero opened this issue Jan 25, 2024 · 2 comments

Comments

@dsiguero
Copy link

dsiguero commented Jan 25, 2024

Describe the bug
krr simple --logtostderr -f json > result.json does not produce valid JSON.

To Reproduce
Steps to reproduce the behavior:

$ krr simple --logtostderr -f json > result.json
[...]

$ jq '.' result.json
jq: parse error: Invalid numeric literal at line 1, column 12

$ head -n1 result.json
Calculating Recommendation |████████████████████████████████████████| 50 in 10.8s (4.61/s)

Expected behavior
The resulting JSON file should be valid.

Are you interested in contributing a fix for this?
Yes.

Additional context:

  • OS: macOS Sonoma 14.2.1
  • Installation method: brew
  • krr version: v1.6.0
@dsiguero
Copy link
Author

dsiguero commented Jan 25, 2024

This seems to also apply to the YAML formatter as well, when running the following command:

$ krr simple --logtostderr -f yaml > result.yaml
[...]

$ yq '.' result.yaml
Error: bad file 'out.yaml': yaml: line 2: mapping values are not allowed in this context

$ head -n1 result.yaml
Calculating Recommendation |████████████████████████████████████████| 50 in 11.2s (4.46/s)

@rohank07
Copy link
Contributor

I believe this is resolved on the main branch - waiting on a new release

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

2 participants