(yaml_file: Text)
load yaml file and check file content format
load yaml file and check file content format
load yaml file and check file content format
def _load_yaml_file(yaml_file: Text) -> Dict:
    """ load yaml file and check file content format
    """
    with open(yaml_file, mode="rb") as stream:
        try:
            yaml_content = yaml.load(stream)
        except yaml.YAMLError as ex:
            err_msg = f"YAMLError:\nfile: {yaml_file}\nerror: {ex}"
            logger.error(err_msg)
            raise exceptions.FileFormatError

        return yaml_content
def _load_yaml_file ( yaml_file : Text ) -> Dict : with open ( yaml_file , mode = "rb" ) as stream : try : yaml_content = yaml . load ( stream ) except yaml . YAMLError as ex : err_msg = f"YAMLError:\nfile: {yaml_file}\nerror: {ex}" logger . error ( err_msg ) raise exceptions . FileFormatError return yaml_content