Skip to content

Commit 9ca6cc9

Browse files
committed
remove more str types, possible fix for edam failed test
1 parent d65fb83 commit 9ca6cc9

File tree

6 files changed

+127
-110
lines changed

6 files changed

+127
-110
lines changed

schema_salad/main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
def printrdf(workflow, wf, ctx, sr):
26-
# type: (str, Union[Dict[Any, Any], str, unicode], Dict[str, Any], str) -> None
26+
# type: (str, Union[List, Dict[Any, Any], str, unicode], Dict[unicode, Any], str) -> None
2727
g = Graph().parse(data=json.dumps(wf), format='json-ld',
2828
location=workflow, context=ctx)
2929
print(g.serialize(format=sr))
@@ -140,7 +140,12 @@ def main(argsl=None): # type: (List[str]) -> int
140140

141141
# Make the Avro validation that will be used to validate the target
142142
# document
143-
(avsc_names, avsc_obj) = schema.make_avro_schema(schema_doc, document_loader)
143+
if isinstance(schema_doc, list):
144+
(avsc_names, avsc_obj) = schema.make_avro_schema(
145+
schema_doc, document_loader)
146+
else:
147+
_logger.error("Schema `%s` must be a list.", args.schema)
148+
return 1
144149

145150
if isinstance(avsc_names, Exception):
146151
_logger.error("Schema `%s` error:\n%s", args.schema,

0 commit comments

Comments
 (0)