diff --git a/src/citrine/__version__.py b/src/citrine/__version__.py index 6c235c596..f5752882d 100644 --- a/src/citrine/__version__.py +++ b/src/citrine/__version__.py @@ -1 +1 @@ -__version__ = "5.2.0" +__version__ = "5.3.0" diff --git a/src/citrine/resources/ingestion.py b/src/citrine/resources/ingestion.py index 424e1a196..08ce0d994 100644 --- a/src/citrine/resources/ingestion.py +++ b/src/citrine/resources/ingestion.py @@ -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): diff --git a/tests/resources/test_ingestion.py b/tests/resources/test_ingestion.py index f214e5361..7fede465b 100644 --- a/tests/resources/test_ingestion.py +++ b/tests/resources/test_ingestion.py @@ -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)