Skip to content

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

IssueList #

Bases: list, Sequence[NeatIssue]

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.

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 #

Bases: NeatIssue, Exception

This is the base class for all exceptions (errors) used in Neat.

NeatIssue dataclass #

This is the base class for all exceptions and warnings (issues) used in Neat.

as_message(include_type=True) #

Return a human-readable message for the issue.

dump() #

Return a dictionary representation of the issue.

load(data) classmethod #

Create an instance of the issue from a dictionary.

NeatWarning dataclass #

Bases: NeatIssue, UserWarning

This is the base class for all warnings used in Neat.

catch_issues(read_info_by_sheet=None) #

This is an internal help function to handle issues and warnings.

Parameters:

Name Type Description Default
read_info_by_sheet dict[str, SpreadsheetRead]

The read information by sheet. This is used to adjust the row numbers in the errors/warnings.

None

Returns:

Name Type Description
IssueList Iterator[IssueList]

The list of issues.

catch_warnings() #

Catch warnings and append them to the issues list.