-
Notifications
You must be signed in to change notification settings - Fork 192
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
Not all definitions in JSON schema have a "properties", leading to an error #1521
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1521 +/- ##
==========================================
- Coverage 64.61% 64.59% -0.02%
==========================================
Files 54 54
Lines 6178 6192 +14
==========================================
+ Hits 3992 4000 +8
- Misses 2186 2192 +6
Continue to review full report at Codecov.
|
nf_core/schema.py
Outdated
|
||
# Remove "allOf" group with empty definitions from the schema | ||
for d_key in empty_definitions: | ||
allOf = {"$ref": "#/definitions/{}".format(d_key)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on this PR at the moment so no need to change, but FYI we are trying to slowly move everything to the new format string style in the codebase now (with a few exceptions where this old style is still clearer). Generally it's much easier to read and maintain.
So here it'd be:
allOf = {"$ref": "#/definitions/{}".format(d_key)} | |
allOf = {"$ref": f"#/definitions/{d_key}"} |
Just prepend the string quotes with f
and then stick the variable name into the squiggly brackets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote this whole function to use Python list comprehension so that you didn't need to use deep copies. But the code ended up being uglier so I ditched it. Then I realised that you didn't actually need deep copies with your existing code 😅
Minor cleanup, hope that's ok. LGTM now 👍🏻
Changes:
- Added log warning
- Use
get
to avoid crashes ifproperties
orallOf
keys not set - Moved function call out of function to remove missing config parameters
- Added call to the function on the object returned from the web builder
Closes #1419