Skip to content

Commit

Permalink
Use Loader=CSafeLoader to load YAMLs faster (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
myakove authored Dec 1, 2024
1 parent fe30df5 commit 72cdc75
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions must_gather_explorer/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

import sys
from functools import lru_cache
from typing import Any, Dict, List
from pathlib import Path
from tqdm import tqdm
Expand Down Expand Up @@ -90,7 +89,7 @@ def main(path: str, verbose: bool) -> None:

with open(yaml_file_path) as fd:
try:
resource_dictionary = yaml.safe_load(fd)
resource_dictionary = yaml.load(fd, Loader=yaml.CSafeLoader)
except yaml.constructor.ConstructorError as exp:
LOGGER.debug(f"Error parsing YAML file {yaml_file_path}: {exp}")
continue
Expand Down Expand Up @@ -283,7 +282,6 @@ def get_cluster_resources_raw_data(
return resources_list


@lru_cache
def get_resource_kind_by_alias(resources_aliases: Dict[str, List[str]], requested_kind: str) -> str:
kind_lower = requested_kind.lower()

Expand Down

0 comments on commit 72cdc75

Please sign in to comment.