Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces unsafe yaml loaders with yaml.safe_load #3753

Merged
merged 4 commits into from
Jun 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions wandb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,11 +1014,7 @@ def image_from_docker_args(args: List[str]) -> Optional[str]:


def load_yaml(file: Any) -> Any:
"""If pyyaml > 5.1 use full_load to avoid warning"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open question: what warning was this? And do we actually use the functionality of full_load?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It must have been a deprecation warning like shown here yaml/pyyaml#265

if hasattr(yaml, "full_load"):
return yaml.full_load(file)
else:
return yaml.load(file)
return yaml.safe_load(file)


def image_id_from_k8s() -> Optional[str]:
Expand Down