diff options
author | lltommy | 2020-07-07 23:58:50 +0200 |
---|---|---|
committer | lltommy | 2020-07-07 23:58:50 +0200 |
commit | c8ffc952a99dc0a2d1266cdc0636711ec63e8bfb (patch) | |
tree | d8672cca90c8469f07c20cb80fdbf0439913623a /bh20sequploader/qc_metadata.py | |
parent | 027d7bd6dd89c62a1e81bbda0e6ef7f27cbb3920 (diff) | |
parent | b994b59963248a301e1248f792f21d9ab2ea8a3f (diff) | |
download | bh20-seq-resource-c8ffc952a99dc0a2d1266cdc0636711ec63e8bfb.tar.gz bh20-seq-resource-c8ffc952a99dc0a2d1266cdc0636711ec63e8bfb.tar.lz bh20-seq-resource-c8ffc952a99dc0a2d1266cdc0636711ec63e8bfb.zip |
Merge branch 'master' of https://github.com/arvados/bh20-seq-resource
Diffstat (limited to 'bh20sequploader/qc_metadata.py')
-rw-r--r-- | bh20sequploader/qc_metadata.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/bh20sequploader/qc_metadata.py b/bh20sequploader/qc_metadata.py index 9122ace..2b57991 100644 --- a/bh20sequploader/qc_metadata.py +++ b/bh20sequploader/qc_metadata.py @@ -21,20 +21,13 @@ def qc_metadata(metadatafile): shex = pkg_resources.resource_stream(__name__, "bh20seq-shex.rdf").read().decode("utf-8") if not isinstance(avsc_names, schema_salad.avro.schema.Names): - print(avsc_names) - return False + raise Exception(avsc_names) - try: - doc, metadata = schema_salad.schema.load_and_validate(document_loader, avsc_names, metadatafile, True) - g = schema_salad.jsonld_context.makerdf("workflow", doc, document_loader.ctx) - rslt, reason = evaluate(g, shex, doc["id"], "https://raw.githubusercontent.com/arvados/bh20-seq-resource/master/bh20sequploader/bh20seq-shex.rdf#submissionShape") + doc, metadata = schema_salad.schema.load_and_validate(document_loader, avsc_names, metadatafile, True) + g = schema_salad.jsonld_context.makerdf("workflow", doc, document_loader.ctx) + rslt, reason = evaluate(g, shex, doc["id"], "https://raw.githubusercontent.com/arvados/bh20-seq-resource/master/bh20sequploader/bh20seq-shex.rdf#submissionShape") - if not rslt: - log.debug(reason) - print(reason) + if not rslt: + raise Exception(reason) - return rslt - except Exception as e: - traceback.print_exc() - log.warn(e) - return False + return True |