def load_yaml_text(contents):
try:
return yaml.safe_load(contents)
except (yaml.scanner.ScannerError, yaml.YAMLError) as e:
if hasattr(e, 'problem_mark'):
error = contextualized_yaml_error(contents, e)
else:
error = dbt.compat.to_string(e)
raise dbt.exceptions.ValidationException(error)
评论列表
文章目录