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
#
Bases: NeatWarning
{category}: {warning}
Source code in cognite/neat/_issues/_base.py
IssueList
#
Bases: NeatIssueList[NeatIssue]
This is a list of NeatIssues.
Source code in cognite/neat/_issues/_base.py
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.
Source code in cognite/neat/_issues/_base.py
NeatError
dataclass
#
Bases: NeatIssue
, Exception
This is the base class for all exceptions (errors) used in Neat.
Source code in cognite/neat/_issues/_base.py
from_pydantic_errors(errors, **kwargs)
classmethod
#
Convert a list of pydantic errors to a list of Error instances.
This is intended to be overridden in subclasses to handle specific error types.
Source code in cognite/neat/_issues/_base.py
NeatIssue
dataclass
#
This is the base class for all exceptions and warnings (issues) used in Neat.
Source code in cognite/neat/_issues/_base.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
as_message(include_type=True)
#
Return a human-readable message for the issue.
Source code in cognite/neat/_issues/_base.py
dump()
#
Return a dictionary representation of the issue.
Source code in cognite/neat/_issues/_base.py
load(data)
classmethod
#
Create an instance of the issue from a dictionary.
Source code in cognite/neat/_issues/_base.py
NeatIssueList
#
Bases: list
, Sequence[T_NeatIssue]
, ABC
This is a generic list of NeatIssues.
Source code in cognite/neat/_issues/_base.py
errors: Self
property
#
Return all the errors in this list.
has_errors: bool
property
#
Return True if this list contains any errors.
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.
as_errors(operation='Operation failed')
#
Return an ExceptionGroup with all the errors in this list.
Source code in cognite/neat/_issues/_base.py
trigger_warnings()
#
to_pandas()
#
NeatWarning
dataclass
#
Bases: NeatIssue
, UserWarning
This is the base class for all warnings used in Neat.
Source code in cognite/neat/_issues/_base.py
from_warning(warning)
classmethod
#
catch_issues(issues, error_cls=NeatError, warning_cls=NeatWarning, error_args=None)
#
This is an internal help function to handle issues and warnings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
issues |
IssueList
|
The issues list to append to. |
required |
error_cls |
type[NeatError]
|
The class used to convert errors to issues. |
NeatError
|
warning_cls |
type[NeatWarning]
|
The class used to convert warnings to issues. |
NeatWarning
|
Returns:
Name | Type | Description |
---|---|---|
FutureResult |
Iterator[FutureResult]
|
A future result object that can be used to check the result of the context manager. |
Source code in cognite/neat/_issues/_base.py
catch_warnings(issues=None, warning_cls=DefaultWarning)
#
Catch warnings and append them to the issues list.