Skip to content

Commit 7bfe73a

Browse files
authored
Use schema_salad.avro.schema.Name according to docs (#1281)
1 parent 4fd2308 commit 7bfe73a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cwltool/builder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ def bind_input(
254254
bound_input = False
255255
for t in schema["type"]:
256256
avsc = None # type: Optional[Schema]
257-
if isinstance(t, str) and self.names.has_name(t, ""):
258-
avsc = self.names.get_name(t, "")
257+
if isinstance(t, str) and self.names.has_name(t, None):
258+
avsc = self.names.get_name(t, None)
259259
elif (
260260
isinstance(t, MutableMapping)
261261
and "name" in t
262-
and self.names.has_name(t["name"], "")
262+
and self.names.has_name(t["name"], None)
263263
):
264-
avsc = self.names.get_name(t["name"], "")
264+
avsc = self.names.get_name(t["name"], None)
265265
if not avsc:
266266
avsc = make_avsc_object(convert_to_dict(t), self.names)
267267
if validate.validate(avsc, datum):

cwltool/command_line_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ def __init__(self, msg, **kwargs): # type: (str, **Any) -> None
851851
if compute_checksum:
852852
adjustFileObjs(ret, partial(compute_checksums, fs_access))
853853
expected_schema = cast(
854-
Schema, self.names.get_name("outputs_record_schema", "")
854+
Schema, self.names.get_name("outputs_record_schema", None)
855855
)
856856
validate.validate_ex(
857857
expected_schema, ret, strict=False, logger=_logger_validation_warnings

cwltool/process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def _init_job(self, joborder, runtime_context):
729729
fill_in_defaults(self.tool["inputs"], job, fs_access)
730730

731731
normalizeFilesDirs(job)
732-
schema = self.names.get_name("input_record_schema", "")
732+
schema = self.names.get_name("input_record_schema", None)
733733
if schema is None:
734734
raise WorkflowException(
735735
"Missing input record schema: " "{}".format(self.names)
@@ -964,7 +964,7 @@ def validate_hints(self, avsc_names, hints, strict):
964964
sl = SourceLine(hints, i, validate.ValidationException)
965965
with sl:
966966
if (
967-
avsc_names.get_name(r["class"], "") is not None
967+
avsc_names.get_name(r["class"], None) is not None
968968
and self.doc_loader is not None
969969
):
970970
plain_hint = dict(
@@ -973,7 +973,7 @@ def validate_hints(self, avsc_names, hints, strict):
973973
if key not in self.doc_loader.identifiers
974974
) # strip identifiers
975975
validate.validate_ex(
976-
avsc_names.get_name(plain_hint["class"], ""),
976+
avsc_names.get_name(plain_hint["class"], None),
977977
plain_hint,
978978
strict=strict,
979979
)

0 commit comments

Comments
 (0)