Skip to content

Fix #409: checkFormat fails for Null input #410

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

Merged
merged 18 commits into from
Jun 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ def formatSubclassOf(fmt, cls, ontology, visited):
def checkFormat(actualFile, inputFormats, ontology):
# type: (Union[Dict[Text, Any], List, Text], Union[List[Text], Text], Graph) -> None
for af in aslist(actualFile):
if not af:
continue
if "format" not in af:
raise validate.ValidationException(u"Missing required 'format' for File %s" % af)
for inpf in aslist(inputFormats):
Expand Down
8 changes: 4 additions & 4 deletions cwltool/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ def match_types(sinktype, src, iid, inputobj, linkMerge, valueFrom):
return True
elif isinstance(src.parameter["type"], list):
# Source is union type
# Check that every source type is compatible with the sink.
# Check that at least one source type is compatible with the sink.
for st in src.parameter["type"]:
srccopy = copy.deepcopy(src)
srccopy.parameter["type"] = st
if not match_types(st, srccopy, iid, inputobj, linkMerge, valueFrom):
return False
return True
if match_types(sinktype, srccopy, iid, inputobj, linkMerge, valueFrom):
return True
return False
elif linkMerge:
if iid not in inputobj:
inputobj[iid] = []
Expand Down