IBM / mi-prometheus

Enabling reproducible Machine Learning research
http://mi-prometheus.rtfd.io/
Apache License 2.0
42 stars 18 forks source link

Yaml warning: loading can be potentially harmful #141

Open tsjayram opened 5 years ago

tsjayram commented 5 years ago

Describe the bug The YAML loading can potentially be harmful, as seen in the run below. Applies to all scripts that use it.

/Users/jayram/Projects/mi-prometheus/miprometheus/utils/param_interface.py:283: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. params_from_yaml = yaml.load(stream)

Desktop (please complete the following information):

tkornuta-ibm commented 5 years ago

I have just checked the worker.py, which actually loads the config, and down there I use save_load:

            # Open file and get parameter dictionary.
            with open(config, 'r') as stream:
                param_dict = yaml.safe_load(stream)

I think the method in param_interface wasn't used... but fixed it anyway.