from pathlib import Path


def load_query(file_path: str | Path) -> str:
    """
    Loads a query from a file

    Args:
        file_path (str): The path to the file

    Returns:
        str: The query
    """
    if not str(file_path).endswith(".sql"):
        raise ResourceWarning("Given file path does not end with .sql")

    with open(file_path, "r", encoding="UTF-8") as sql_query_file:
        return sql_query_file.read()