Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update property to dc_access_requirements #663

Merged
merged 1 commit into from
Aug 9, 2024
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
8 changes: 4 additions & 4 deletions home/service/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
}

Expand Down Expand Up @@ -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
),
}

Expand Down Expand Up @@ -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
),
}

Expand All @@ -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
),
}
2 changes: 1 addition & 1 deletion lib/datahub-client/data_platform_catalogue/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
17 changes: 8 additions & 9 deletions lib/datahub-client/tests/client/datahub/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down
2 changes: 1 addition & 1 deletion templates/details_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h3 class="govuk-heading-s govuk-!-margin-top-3">
</div>
</div>
<div class="govuk-grid-column-one-third">
{% 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%}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion tests/home/service/test_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_details_contact_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down