Base
cognite.neat._issues
#
This is module contains all the Neat Exceptions (Errors) and Warnings as well as some helper classes to handle them like NeatIssueList
DefaultWarning
dataclass
#
IssueList
#
MultiValueError
#
Bases: ValueError
This is a container for multiple errors.
It is used in the pydantic field_validator/model_validator to collect multiple errors, which can then be caught in a try-except block and returned as an IssueList.
NeatError
dataclass
#
NeatIssue
dataclass
#
NeatIssueList
#
Bases: list
, Sequence[T_NeatIssue]
, ABC
This is a generic list of NeatIssues.
errors: Self
property
#
Return all the errors in this list.
has_errors: bool
property
#
Return True if this list contains any errors.
has_warnings: bool
property
#
Return True if this list contains any warnings.
warnings: Self
property
#
Return all the warnings in this list.
has_error_type(error_type)
#
Return True if this list contains any errors of the given type.
has_warning_type(warning_type)
#
Return True if this list contains any warnings of the given type.
as_errors(operation='Operation failed')
#
Return an ExceptionGroup with all the errors in this list.
trigger_warnings()
#
Trigger all warnings in this list.
to_pandas()
#
Return a pandas DataFrame representation of this list.
as_exception()
#
Return a MultiValueError with all the errors in this list.
NeatWarning
dataclass
#
catch_issues(error_args=None)
#
This is an internal help function to handle issues and warnings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
error_args |
dict[str, Any] | None
|
Additional arguments to pass to the error class. The only use case as of (2025-01-03) is to pass the read_info_by_sheet to the error class such that the row numbers can be adjusted to match the source spreadsheet. |
None
|
Returns:
Name | Type | Description |
---|---|---|
IssueList |
Iterator[IssueList]
|
The list of issues. |
catch_warnings()
#
Catch warnings and append them to the issues list.