diff --git a/home/service/details.py b/home/service/details.py index 8f7933ee..9612a5ee 100644 --- a/home/service/details.py +++ b/home/service/details.py @@ -70,7 +70,7 @@ def _get_context(self): "h1_value": self.database_metadata.name, "is_esda": self.is_esda, "is_access_requirements_a_url": is_access_requirements_a_url( - self.database_metadata.custom_properties.access_information.access_requirements + self.database_metadata.custom_properties.access_information.dc_access_requirements ), } @@ -108,7 +108,7 @@ def _get_context(self): "has_lineage": self.has_lineage(), "lineage_url": f"{split_datahub_url.scheme}://{split_datahub_url.netloc}/dataset/{self.table_metadata.urn}/Lineage?is_lineage_mode=true&", # noqa: E501 "is_access_requirements_a_url": is_access_requirements_a_url( - self.table_metadata.custom_properties.access_information.access_requirements + self.table_metadata.custom_properties.access_information.dc_access_requirements ), } @@ -141,7 +141,7 @@ def _get_context(self): "parent_type": ResultType.DASHBOARD.name.lower(), "h1_value": self.chart_metadata.name, "is_access_requirements_a_url": is_access_requirements_a_url( - self.chart_metadata.custom_properties.access_information.access_requirements + self.chart_metadata.custom_properties.access_information.dc_access_requirements ), } @@ -164,6 +164,6 @@ def _get_context(self): key=lambda d: d.entity_ref.display_name, ), "is_access_requirements_a_url": is_access_requirements_a_url( - self.dashboard_metadata.custom_properties.access_information.access_requirements + self.dashboard_metadata.custom_properties.access_information.dc_access_requirements ), } diff --git a/lib/datahub-client/data_platform_catalogue/entities.py b/lib/datahub-client/data_platform_catalogue/entities.py index bcfb5143..5eacea3f 100644 --- a/lib/datahub-client/data_platform_catalogue/entities.py +++ b/lib/datahub-client/data_platform_catalogue/entities.py @@ -231,7 +231,7 @@ class AccessInformation(BaseModel): "s3://alpha-hmpps-reports-data", ], ) - access_requirements: str = Field( + dc_access_requirements: str = Field( description="Paragraph explaning whether there are any specific access requirements related these data.", default="", examples=[ diff --git a/lib/datahub-client/tests/client/datahub/test_search.py b/lib/datahub-client/tests/client/datahub/test_search.py index 7db58609..4d11f6d7 100644 --- a/lib/datahub-client/tests/client/datahub/test_search.py +++ b/lib/datahub-client/tests/client/datahub/test_search.py @@ -2,7 +2,6 @@ from unittest.mock import MagicMock import pytest - from data_platform_catalogue.client.search import SearchClient from data_platform_catalogue.entities import ( AccessInformation, @@ -143,7 +142,7 @@ def test_one_search_result(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", @@ -234,7 +233,7 @@ def test_dataset_result(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", @@ -328,7 +327,7 @@ def test_full_page(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", @@ -362,7 +361,7 @@ def test_full_page(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", @@ -394,7 +393,7 @@ def test_full_page(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", @@ -476,7 +475,7 @@ def test_query_match(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", @@ -554,7 +553,7 @@ def test_result_with_owner(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", @@ -927,7 +926,7 @@ def test_search_for_charts(mock_graph, searcher): "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "refresh_period": "", "last_updated": "", "row_count": "", diff --git a/lib/datahub-client/tests/snapshots/test_upsert_table.json b/lib/datahub-client/tests/snapshots/test_upsert_table.json index 4ac67c71..3a365a84 100644 --- a/lib/datahub-client/tests/snapshots/test_upsert_table.json +++ b/lib/datahub-client/tests/snapshots/test_upsert_table.json @@ -12,7 +12,7 @@ "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "row_count": "5", "refresh_period": "", "last_updated": "", diff --git a/lib/datahub-client/tests/snapshots/test_upsert_table_and_database.json b/lib/datahub-client/tests/snapshots/test_upsert_table_and_database.json index abdd3d0e..85e9eeba 100644 --- a/lib/datahub-client/tests/snapshots/test_upsert_table_and_database.json +++ b/lib/datahub-client/tests/snapshots/test_upsert_table_and_database.json @@ -25,7 +25,7 @@ "dc_where_to_access_dataset": "analytical_platform", "source_dataset_name": "", "s3_location": "s3://databucket/", - "access_requirements": "", + "dc_access_requirements": "", "row_count": "", "refresh_period": "", "last_updated": "", @@ -89,7 +89,7 @@ "dc_where_to_access_dataset": "", "source_dataset_name": "", "s3_location": "", - "access_requirements": "", + "dc_access_requirements": "", "row_count": "5", "refresh_period": "", "last_updated": "", diff --git a/templates/details_base.html b/templates/details_base.html index 711f1eee..8ca077a3 100644 --- a/templates/details_base.html +++ b/templates/details_base.html @@ -90,7 +90,7 @@

- {% include "partial/contact_info.html" with data_owner=entity.governance.data_owner.display_name data_owner_email=entity.governance.data_owner.email slack_channel=entity.custom_properties.further_information access_requirements=entity.custom_properties.access_information.access_requirements is_access_url=is_access_requirements_a_url%} + {% include "partial/contact_info.html" with data_owner=entity.governance.data_owner.display_name data_owner_email=entity.governance.data_owner.email slack_channel=entity.custom_properties.further_information access_requirements=entity.custom_properties.access_information.dc_access_requirements is_access_url=is_access_requirements_a_url%}
diff --git a/tests/home/service/test_details.py b/tests/home/service/test_details.py index 33486935..68efe211 100644 --- a/tests/home/service/test_details.py +++ b/tests/home/service/test_details.py @@ -245,7 +245,7 @@ def test_chart_entities_in_context(self, example_dashboard: Dashboard): def test_custom_properties_in_context(self, mock_catalogue): custom_properties = CustomEntityProperties( access_information=AccessInformation( - access_requirements="This is a test there's nothing to access" + dc_access_requirements="This is a test there's nothing to access" ) ) mock_dashboard_name = "urn:li:dashboard:fake" diff --git a/tests/integration/test_details_contact_contents.py b/tests/integration/test_details_contact_contents.py index 9e7c8a22..c75f5095 100644 --- a/tests/integration/test_details_contact_contents.py +++ b/tests/integration/test_details_contact_contents.py @@ -61,7 +61,7 @@ def test_access_requirements_content( """ test_database = generate_database_metadata( custom_properties=CustomEntityProperties( - access_information=AccessInformation(access_requirements=access_reqs) + access_information=AccessInformation(dc_access_requirements=access_reqs) ) ) mock_get_database_details_response(mock_catalogue, test_database)