Mezura / api /client.py
nmmursit's picture
initial commit
3232d64 verified
"""
Base API client module for Mezura.
"""
import logging
from typing import Dict, Any, Optional, Type
# Create logger
logger = logging.getLogger(__name__)
class APIClient:
"""Base class for API clients."""
def __init__(self):
"""Initialize the API client."""
pass
def get_api_client(evaluation_type: str = None) -> Optional[Any]:
"""
Get the appropriate API client for the given evaluation type.
Args:
evaluation_type: The type of evaluation (unused, always returns AirflowClient)
Returns:
Optional[Any]: An instance of the AirflowClient, or None if not available
"""
try:
# Import here to avoid circular imports
from api.clients.airflow_client import AirflowClient
# Always return AirflowClient as it's the only client used in the application
return AirflowClient()
except Exception as e:
logger.error(f"Error creating API client: {e}")
return None