You can use one of the Loaders as a parameter to remove the warning message.
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: