YerevaNN / mimic3-benchmarks

Python suite to construct benchmark machine learning datasets from the MIMIC-III 💊 clinical database.
https://arxiv.org/abs/1703.07771
MIT License
806 stars 329 forks source link

Replace add safe Loader argument to yaml load (suppresing the warning message) "mimic3-benchmarks/mimic3benchmark/scripts/extract_subjects.py", … #131

Closed partizanos closed 1 year ago

partizanos commented 2 years ago

There is the following warning in the first step of preprocessing: mimic3-benchmarks/mimic3benchmark/scripts/extract_subjects.py:64: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

The warning is there due to arbitrary shell execution of the deprecated yaml.open .

Adding Loader = yaml.SafeLoader suppreses the warning. I checked that the yaml file we use if for (HCUP complex disease definition) does not have any special character and is parsed safely.

hrayrhar commented 1 year ago

Thanks for the pull request, merging it.