Beispiel #1
0
 def validate_hints(
     self, avsc_names: Names, hints: List[CWLObjectType], strict: bool
 ) -> None:
     for i, r in enumerate(hints):
         sl = SourceLine(hints, i, ValidationException)
         with sl:
             if (
                 avsc_names.get_name(cast(str, r["class"]), None) is not None
                 and self.doc_loader is not None
             ):
                 plain_hint = dict(
                     (key, r[key])
                     for key in r
                     if key not in self.doc_loader.identifiers
                 )  # strip identifiers
                 validate_ex(
                     cast(
                         Schema,
                         avsc_names.get_name(cast(str, plain_hint["class"]), None),
                     ),
                     plain_hint,
                     strict=strict,
                 )
             elif r["class"] in ("NetworkAccess", "LoadListingRequirement"):
                 pass
             else:
                 _logger.info(str(sl.makeError("Unknown hint %s" % (r["class"]))))
Beispiel #2
0
 def validate_hints(self, avsc_names: Names, hints: List[CWLObjectType],
                    strict: bool) -> None:
     if self.doc_loader is None:
         return
     debug = _logger.isEnabledFor(logging.DEBUG)
     for i, r in enumerate(hints):
         sl = SourceLine(hints, i, ValidationException, debug)
         with sl:
             classname = cast(str, r["class"])
             avroname = classname
             if classname in self.doc_loader.vocab:
                 avroname = avro_type_name(self.doc_loader.vocab[classname])
             if avsc_names.get_name(avroname, None) is not None:
                 plain_hint = {
                     key: r[key]
                     for key in r if key not in self.doc_loader.identifiers
                 }  # strip identifiers
                 validate_ex(
                     cast(
                         Schema,
                         avsc_names.get_name(avroname, None),
                     ),
                     plain_hint,
                     strict=strict,
                     vocab=self.doc_loader.vocab,
                 )
             elif r["class"] in ("NetworkAccess", "LoadListingRequirement"):
                 pass
             else:
                 _logger.info(
                     str(sl.makeError("Unknown hint %s" % (r["class"]))))
Beispiel #3
0
 def validate_hints(self, avsc_names, hints, strict):
     # type: (Any, List[Dict[Text, Any]], bool) -> None
     for i, r in enumerate(hints):
         sl = SourceLine(hints, i, validate.ValidationException)
         with sl:
             if avsc_names.get_name(r["class"], "") is not None:
                 plain_hint = dict((key, r[key]) for key in r if key not in
                                   self.doc_loader.identifiers)  # strip identifiers
                 validate.validate_ex(
                     avsc_names.get_name(plain_hint["class"], ""),
                     plain_hint, strict=strict)
             else:
                 _logger.info(sl.makeError(u"Unknown hint %s" % (r["class"])))
Beispiel #4
0
 def validate_hints(self, avsc_names, hints, strict):
     # type: (Any, List[Dict[Text, Any]], bool) -> None
     for i, r in enumerate(hints):
         sl = SourceLine(hints, i, validate.ValidationException)
         with sl:
             if avsc_names.get_name(r["class"], "") is not None:
                 plain_hint = dict((key, r[key]) for key in r if key not in
                                   self.doc_loader.identifiers)  # strip identifiers
                 validate.validate_ex(
                     avsc_names.get_name(plain_hint["class"], ""),
                     plain_hint, strict=strict)
             else:
                 _logger.info(sl.makeError(u"Unknown hint %s" % (r["class"])))
Beispiel #5
0
 def validate_hints(self, avsc_names, hints, strict):
     # type: (Any, List[Dict[str, Any]], bool) -> None
     for i, r in enumerate(hints):
         sl = SourceLine(hints, i, validate.ValidationException)
         with sl:
             if (avsc_names.get_name(r["class"], "") is not None
                     and self.doc_loader is not None):
                 plain_hint = dict(
                     (key, r[key]) for key in r if key not in
                     self.doc_loader.identifiers)  # strip identifiers
                 validate.validate_ex(
                     avsc_names.get_name(plain_hint["class"], ""),
                     plain_hint,
                     strict=strict,
                 )
             elif r["class"] in ("NetworkAccess", "LoadListingRequirement"):
                 pass
             else:
                 _logger.info(
                     str(sl.makeError("Unknown hint %s" % (r["class"]))))