|
""" |
|
Base API client module for Mezura. |
|
""" |
|
|
|
import logging |
|
from typing import Dict, Any, Optional, Type |
|
|
|
|
|
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: |
|
|
|
from api.clients.airflow_client import AirflowClient |
|
|
|
|
|
return AirflowClient() |
|
|
|
except Exception as e: |
|
logger.error(f"Error creating API client: {e}") |
|
return None |