From 379f491b9c5ed67a20c26a0457b0ad667a9af603 Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Thu, 26 Oct 2023 18:44:42 -0400 Subject: [PATCH] Change yaml.safe_load to YAML(typ='safe',...).load... b/c deprecations --- boa/wrappers/wrapper_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/boa/wrappers/wrapper_utils.py b/boa/wrappers/wrapper_utils.py index bdcf8a3..200d827 100644 --- a/boa/wrappers/wrapper_utils.py +++ b/boa/wrappers/wrapper_utils.py @@ -18,13 +18,13 @@ from functools import wraps from typing import TYPE_CHECKING, Type -import ruamel.yaml as yaml from attrs import asdict from ax.core.base_trial import BaseTrial from ax.core.parameter import ChoiceParameter, FixedParameter, RangeParameter from ax.exceptions.core import AxError from ax.storage.json_store.encoder import object_to_json from ax.utils.common.docutils import copy_doc +from ruamel.yaml import YAML from boa.definitions import IS_WINDOWS, PathLike, PathLike_tup from boa.logger import get_logger @@ -229,7 +229,8 @@ def load_yaml_from_str(string: str, render_jinja: bool = True, **kwargs): """Load yaml from a string with jinja2 optional templating""" if render_jinja: string = render_template(string, **kwargs) - return yaml.safe_load(string) + yaml = YAML(typ="safe", pure=True) + return yaml.load(string) @copy_doc(load_json)