Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZARP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zavolan_group
pipelines
ZARP
Commits
b7dc184a
Commit
b7dc184a
authored
3 years ago
by
Dominik Burri
Browse files
Options
Downloads
Patches
Plain Diff
separate empty and erroneous optional field.
parent
3baa76e2
No related branches found
No related tags found
1 merge request
!91
Config validation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
workflow/Snakefile
+6
-3
6 additions, 3 deletions
workflow/Snakefile
with
6 additions
and
3 deletions
workflow/Snakefile
+
6
−
3
View file @
b7dc184a
...
...
@@ -38,14 +38,17 @@ if missing:
logger.error(err_msg)
raise ValueError(err_msg)
# Check if optional field available
if 'optional' not in config
or type(config['optional']) not in [OrderedDict, dict]
:
logger.info(f'No "optional"
field found or no valid
configuration.')
if 'optional' not in config:
logger.info(f'No "optional"
section found, adding dictionary "optional" to
configuration.')
config['optional'] = {}
if type(config['optional']) not in [OrderedDict, dict]:
logger.error(f'No valid section "optional" supplied. Got {config["optional"]}, type: {type(config["optional"])} but require dictionary.')
raise TypeError
# Check optional fields and include in config if not present
for optkey, value in template_config['optional'].items():
if optkey not in config['optional']:
config['optional'][optkey] = value
logger.info(f'
Set default
value for optional parameter "{optkey}"
to
: "{value}"')
logger.info(f'
No
value for optional parameter "{optkey}"
found, set to default
: "{value}"')
# Parse YAML rule config file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment