from functools import lru_cache from odps import ODPS from app.core.config import settings @lru_cache def get_odps_client() -> ODPS: return ODPS( access_id=settings.odps_access_id, secret_access_key=settings.odps_access_key, project=settings.odps_project, endpoint=settings.odps_endpoint, ) def odps_check_project_access() -> bool: odps_client = get_odps_client() odps_client.exist_project(settings.odps_project) return True