dandi / dandisets-healthstatus

Healthchecks of dandisets and support libraries (pynwb and matnwb)
0 stars 1 forks source link

dandiset id should be forced into str while dumped into yaml #50

Closed yarikoptic closed 1 year ago

yarikoptic commented 1 year ago

ATM it is

diff --git a/results/000296/status.yaml b/results/000296/status.yaml
index b997254..c8ded8e 100644
--- a/results/000296/status.yaml
+++ b/results/000296/status.yaml
@@ -1,11 +1,11 @@
+dandiset: 000296

so can be treated as int (not sure if yaml format standard forces into str if seemingly number starts with 0 or not) and causes yq to puke

(venv) (base) dandi@drogon:~/cronlib/dandisets-healthstatus$ yq .versions < results/000296/status.yaml
yq: Error running jq: ValueError: invalid literal for int() with base 8: '000296'.

or the issue is in yq?

jwodder commented 1 year ago

@yarikoptic I can't tell from the YAML standard who's in the right, but PyYAML considers a bare 000296 to be a string.

yarikoptic commented 1 year ago

https://github.com/yaml/pyyaml also

❯ python3 -c 'import yaml; print(repr(yaml.load(open("/tmp/tricky.yaml"), yaml.SafeLoader)))'
{'id': '000295'}

I guess it is yq issue, let's forget about it for now