def METHOD_NAME(user_id: int) -> PrincipalModel:
    principal = db.session.query(PrincipalModel).filter(PrincipalModel.user_id == user_id).first()
    if isinstance(principal, PrincipalModel):
        return principal
    raise ApiError(
        error_code="no_principal_found",
        message=f"No principal was found for user_id: {user_id}",
    )