Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/citrine/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.2.0"
__version__ = "5.3.0"
11 changes: 11 additions & 0 deletions src/citrine/resources/ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ class IngestionErrorType(BaseEnumeration):
INCOMPATIBLE_UNITS = "incompatible_units"
EXISTING_TEMPLATE_WITH_REAL_BOUNDS = "existing_template_with_real_bounds"
EMPTY_ASPECT_NAME = "empty_aspect_name"
FILE_EXTENSION_IS_NOT_DEFINED = "file_extension_is_not_defined"
MISSING_ROW_IDENTIFIER = "missing_row_identifier"
DATASET_FILE_ID_NOT_FOUND = "dataset_file_id_not_found"
DATASET_FILE_VERSION_NOT_FOUND = "dataset_file_version_not_found"
EMPTY_FILE = "empty_file"
TYPE_HINT_NOT_FOUND = "type_hint_not_found"
TYPE_HINT_FOUND_MULTIPLE_TIMES = "type_hint_found_multiple_times"
DECODE_FILE_ERROR = "decode_file_error"
CIRCULAR_REFERENCE = "circular_reference"
TEMPLATE_NOT_FOUND_FOR_COLUMN = "template_not_found_for_column"
MIXED_AMOUNT_AND_INGREDIENT = "mixed_amount_and_ingredient"


class IngestionErrorLevel(BaseEnumeration):
Expand Down
32 changes: 32 additions & 0 deletions tests/resources/test_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,35 @@ def _raise_exception():
)
with pytest.raises(IngestionException, match="Missing ingredient"):
ingest.build_objects()


@pytest.mark.parametrize(
"error_type",
[
"file_extension_is_not_defined",
"missing_row_identifier",
"dataset_file_id_not_found",
"dataset_file_version_not_found",
"empty_file",
"type_hint_not_found",
"type_hint_found_multiple_times",
"decode_file_error",
"circular_reference",
"template_not_found_for_column",
"mixed_amount_and_ingredient",
],
)
def test_status_parses_server_error_types(error_type):
status = IngestionStatus.build(
IngestionStatusResponseDataFactory(
errors=[
{
"family": "data",
"error_type": error_type,
"level": "error",
"msg": "Server-side ingestion error",
}
]
)
)
assert status.errors[0].error_type == IngestionErrorType(error_type)
Loading