def _is_session_expired(error_message: str) -> bool:
    """
    Check if the error message indicates that the session is expired.

    Internal utility function used by the retry decorator.

    Args:
        error_message (str): The error message to check.

    Returns:
        bool: True if the session is expired, False otherwise.
    """
    if not error_message:
        return False
    return any(pattern in error_message for pattern in _SESSION_EXPIRATION_PATTERNS)

    Check if the error message indicates that the session is expired.

    Internal utility function used by the retry decorator.

    Args:
        error_message (str): The error message to check.

    Returns:
        bool: True if the session is expired, False otherwise.
    
ai/core/src/unitycatalog/ai/core/utils/retry_utils.py