diff --git a/src/dve/core_engine/configuration/v1/__init__.py b/src/dve/core_engine/configuration/v1/__init__.py index b9b08b6..10a452d 100644 --- a/src/dve/core_engine/configuration/v1/__init__.py +++ b/src/dve/core_engine/configuration/v1/__init__.py @@ -380,7 +380,7 @@ def get_contract_metadata(self) -> DataContractMetadata: } reporting_fields[entity_name] = dataset_config.reporting_fields validators[entity_name] = RowValidator( - contract_dict, entity_name, error_info=error_info + contract_dict, entity_name, error_info=error_info.get(entity_name) ) return DataContractMetadata( diff --git a/tests/testdata/flights/flights_data_contract_error_details.json b/tests/testdata/flights/flights_data_contract_error_details.json index 78e694d..3cf4327 100644 --- a/tests/testdata/flights/flights_data_contract_error_details.json +++ b/tests/testdata/flights/flights_data_contract_error_details.json @@ -1,14 +1,18 @@ { - "country_id": { - "Blank": { - "error_code": "CountryIdIsMissing", - "error_message": "Record Rejected - Country is missing an id" + "country": { + "country_id": { + "Blank": { + "error_code": "CountryIdIsMissing", + "error_message": "Record Rejected - Country is missing an id" + } } }, - "airport_id": { - "Blank": { - "error_code": "AirportIdIsMissing", - "error_message": "Record Rejected - Airport is missing an id" + "airport": { + "airport_id": { + "Blank": { + "error_code": "AirportIdIsMissing", + "error_message": "Record Rejected - Airport is missing an id" + } } } } \ No newline at end of file diff --git a/tests/testdata/movies/movies_contract_error_details.json b/tests/testdata/movies/movies_contract_error_details.json index 260ee96..e457555 100644 --- a/tests/testdata/movies/movies_contract_error_details.json +++ b/tests/testdata/movies/movies_contract_error_details.json @@ -1,27 +1,29 @@ { - "title": { - "Blank": { - "error_code": "BLANKTITLE", - "error_message": "title should not be blank", - "error_level": "submission" - } - }, - "year": { - "Blank": { - "error_code": "BLANKYEAR", - "error_message": "year not provided", - "is_informational": true + "movies": { + "title": { + "Blank": { + "error_code": "BLANKTITLE", + "error_message": "title should not be blank", + "error_level": "submission" + } }, - "Bad value": { - "error_code": "DODGYYEAR", - "error_message": "year value ({{year}}) is invalid", - "reporting_entity": "movies_rename_test" - } - }, - "cast.date_joined": { - "Bad value": { - "error_code": "DODGYDATE", - "error_message": "date_joined value is not valid: {{__error_value}}" + "year": { + "Blank": { + "error_code": "BLANKYEAR", + "error_message": "year not provided", + "is_informational": true + }, + "Bad value": { + "error_code": "DODGYYEAR", + "error_message": "year value ({{year}}) is invalid", + "reporting_entity": "movies_rename_test" + } + }, + "cast.date_joined": { + "Bad value": { + "error_code": "DODGYDATE", + "error_message": "date_joined value is not valid: {{__error_value}}" + } } } } \ No newline at end of file