Repository: SwissDataScienceCenter/renku-python (language: python)

Issue:
Core service `/datasets.edit` endpoint should return `date_published`
Imported datasets have a `date_published` property that is missing from the response when listing datasets in the core service. This field should be added to the `/datasets.list` response.



Discussion / hints:

Fix patch:
diff --git a/renku/domain_model/dataset.py b/renku/domain_model/dataset.py
index 005cc58cba..36626f1f24 100644
--- a/renku/domain_model/dataset.py
+++ b/renku/domain_model/dataset.py
@@ -738,6 +738,7 @@ class DatasetDetailsJson(marshmallow.Schema):
     slug = marshmallow.fields.String(required=True)
     version = marshmallow.fields.String(allow_none=True)
     created_at = marshmallow.fields.String(allow_none=True, attribute="date_created")
+    date_published = marshmallow.fields.String(allow_none=True)
 
     name = marshmallow.fields.String()
     creators = marshmallow.fields.List(marshmallow.fields.Nested(DatasetCreatorsJson))


Test patch:
diff --git a/tests/service/views/test_dataset_views.py b/tests/service/views/test_dataset_views.py
index 1d1e302169..943da0c73e 100644
--- a/tests/service/views/test_dataset_views.py
+++ b/tests/service/views/test_dataset_views.py
@@ -630,6 +630,7 @@ def test_list_datasets_view(svc_client_with_repo):
         "annotations",
         "storage",
         "data_directory",
+        "date_published",
     } == set(response.json["result"]["datasets"][0].keys())
 
 
@@ -678,6 +679,7 @@ def test_list_datasets_view_remote(svc_client_with_repo, it_remote_repo_url):
         "identifier",
         "images",
         "created_at",
+        "date_published",
         "slug",
         "name",
         "creators",
@@ -797,6 +799,7 @@ def test_create_and_list_datasets_view(svc_client_with_repo):
         "annotations",
         "storage",
         "data_directory",
+        "date_published",
     } == set(response.json["result"]["datasets"][0].keys())
 
     assert payload["slug"] in [ds["slug"] for ds in response.json["result"]["datasets"]]