Skip to content

Commit cccf210

Browse files
committed
fixed broken import
1 parent 61c00ca commit cccf210

3 files changed

Lines changed: 33 additions & 2 deletions

File tree

src/runloop_api_client/_utils/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
maybe_transform as maybe_transform,
5959
async_maybe_transform as async_maybe_transform,
6060
)
61-
from ._validation import ValidationNotification as ValidationNotification
6261
from ._reflection import (
6362
function_has_argument as function_has_argument,
6463
assert_signatures_in_sync as assert_signatures_in_sync,
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from __future__ import annotations
2+
3+
from typing import List, Optional
4+
5+
6+
class ValidationNotification:
7+
"""Collects validation errors without raising exceptions.
8+
9+
This follows the notification pattern: validations append errors, and callers
10+
decide how to react (e.g., surface all messages at once or abort).
11+
"""
12+
13+
def __init__(self) -> None:
14+
self._errors: List[str] = []
15+
self._causes: List[Optional[Exception]] = []
16+
17+
def add_error(self, message: str, cause: Optional[Exception] = None) -> None:
18+
self._errors.append(message)
19+
self._causes.append(cause)
20+
21+
def has_errors(self) -> bool:
22+
return len(self._errors) > 0
23+
24+
@property
25+
def errors(self) -> List[str]:
26+
# Return a copy to avoid external mutation
27+
return list(self._errors)
28+
29+
def error_message(self) -> str:
30+
# Join with semicolons to present multiple issues succinctly
31+
return "; ".join(self._errors)

src/runloop_api_client/resources/blueprints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
blueprint_create_from_inspection_params,
1616
)
1717
from .._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
18-
from .._utils import maybe_transform, async_maybe_transform, ValidationNotification
18+
from .._utils import maybe_transform, async_maybe_transform
19+
from .._utils._validation import ValidationNotification
1920
from .._compat import cached_property
2021
from .._resource import SyncAPIResource, AsyncAPIResource
2122
from .._response import (

0 commit comments

Comments
 (0)