예제 #1
0
def is_valid_local_config_source(path: str) -> bool:
    # TODO: this function must be refactored before 1.0 (Han 12.22)
    try:
        from jina.jaml import parse_config_source
        parse_config_source(path)
        return True
    except FileNotFoundError:
        return False
예제 #2
0
파일: helper.py 프로젝트: jina-ai/jina
def is_valid_local_config_source(path: str) -> bool:
    # TODO: this function must be refactored before 1.0 (Han 12.22)
    """
    Check if the path is valid.

    :param path: Local file path.
    :return: True if the path is valid else False.
    """
    try:
        from jina.jaml import parse_config_source

        parse_config_source(path)
        return True
    except FileNotFoundError:
        return False