from typing import Union
from pathlib import Path


def _convert_file_path(file_path: Union[str, Path]) -> Path:
    """Optionally convert the file path into Path.

    Args:
        file_path: file path to convert

    Return:
        the converted file path
    """
    if isinstance(file_path, str):
        file_path = Path(file_path)

    return file_path