From 9b3e6740b3b3b99380aa6773957574c88f0ce1b8 Mon Sep 17 00:00:00 2001 From: Pablo Cavallo Date: Tue, 10 Nov 2026 17:50:56 +0100 Subject: [PATCH 1/2] Map the ingestion error types the server returns --- src/citrine/__version__.py | 2 +- src/citrine/resources/ingestion.py | 11 ++++++++++ tests/resources/test_ingestion.py | 32 ++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/citrine/__version__.py b/src/citrine/__version__.py index 6c235c596..98886d260 100644 --- a/src/citrine/__version__.py +++ b/src/citrine/__version__.py @@ -1 +1 @@ -__version__ = "5.2.0" +__version__ = "5.2.1" 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) From a5d86841fa3176381ba9971c6644738bfae68184 Mon Sep 17 00:00:00 2001 From: Pablo Cavallo Date: Wed, 11 Nov 2026 16:50:13 +0100 Subject: [PATCH 2/2] Minor version bump --- src/citrine/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citrine/__version__.py b/src/citrine/__version__.py index 98886d260..f5752882d 100644 --- a/src/citrine/__version__.py +++ b/src/citrine/__version__.py @@ -1 +1 @@ -__version__ = "5.2.1" +__version__ = "5.3.0"