You can use one of the Loaders as a parameter to remove the warning message.
Replace
yaml.load(paramVals)
With
yaml.load(paramVals, Loader=yaml.FullLoader)
or
yaml.full_load(paramVals)
From the documentation of YAML,
The current Loader choices are:
- BaseLoader: Only loads the most basic YAML
- SafeLoader: Loads a subset of the YAML language, safely. This is recommended for loading untrusted input.
- FullLoader: Loads the full YAML language. Avoids arbitrary code execution. This is currently (PyYAML 5.1) the default loader called by yaml.load(input) (after issuing the warning).
- UnsafeLoader: (also called Loader for backwards compatability)
You may also use one of the shortcut "sugar" methods:
- yaml.safe_load
- yaml.full_load
- yaml.unsafe_load