From 6dd7f359486b1b8b52905935522cc26af1a39aba Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Fri, 22 Mar 2024 10:39:31 +0100 Subject: [PATCH 1/5] rm type in dataset Signed-off-by: ThibaultFy --- .../migrations/0059_remove_datamanager_type.py | 16 ++++++++++++++++ backend/api/models/datamanager.py | 1 - backend/api/tests/asset_factory.py | 2 -- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 backend/api/migrations/0059_remove_datamanager_type.py diff --git a/backend/api/migrations/0059_remove_datamanager_type.py b/backend/api/migrations/0059_remove_datamanager_type.py new file mode 100644 index 000000000..54f32edec --- /dev/null +++ b/backend/api/migrations/0059_remove_datamanager_type.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.9 on 2024-03-22 09:39 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("api", "0058_alter_compute_task_status"), + ] + + operations = [ + migrations.RemoveField( + model_name="datamanager", + name="type", + ), + ] diff --git a/backend/api/models/datamanager.py b/backend/api/models/datamanager.py index e2b38ce55..6b1001a55 100644 --- a/backend/api/models/datamanager.py +++ b/backend/api/models/datamanager.py @@ -20,7 +20,6 @@ class DataManager(models.Model, AssetPermissionMixin): permissions_process_authorized_ids = ArrayField(models.CharField(max_length=1024), size=100) logs_permission_public = models.BooleanField() logs_permission_authorized_ids = ArrayField(models.CharField(max_length=1024), size=100) - type = models.CharField(max_length=100) owner = models.CharField(max_length=100) creation_date = models.DateTimeField() metadata = models.JSONField() diff --git a/backend/api/tests/asset_factory.py b/backend/api/tests/asset_factory.py index bda79bae1..2a7ad1cc1 100644 --- a/backend/api/tests/asset_factory.py +++ b/backend/api/tests/asset_factory.py @@ -262,7 +262,6 @@ def create_function( def create_datamanager( key: uuid.UUID = None, name: str = "datamanager", - type: str = "Test", metadata: dict = None, owner: str = DEFAULT_OWNER, channel: str = DEFAULT_CHANNEL, @@ -273,7 +272,6 @@ def create_datamanager( return DataManager.objects.create( key=key, name=name, - type=type, metadata=metadata or {}, opener_address=get_storage_address("data_manager", key, "opener"), opener_checksum=DUMMY_CHECKSUM, From ac1f4f7824b456061564778158607a6c063d8351 Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Fri, 22 Mar 2024 10:51:49 +0100 Subject: [PATCH 2/5] rm type in dataset Signed-off-by: ThibaultFy --- backend/api/serializers/datamanager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/api/serializers/datamanager.py b/backend/api/serializers/datamanager.py index bef0b095f..e3dec9bad 100644 --- a/backend/api/serializers/datamanager.py +++ b/backend/api/serializers/datamanager.py @@ -29,7 +29,6 @@ class Meta: "opener", "owner", "permissions", - "type", ] def to_representation(self, instance): From 58b444e8baa580509f59ae6a3579d39d3f3ffd3d Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Fri, 22 Mar 2024 11:03:23 +0100 Subject: [PATCH 3/5] rm type in dataset Signed-off-by: ThibaultFy --- backend/api/tests/views/test_views_datamanager.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/backend/api/tests/views/test_views_datamanager.py b/backend/api/tests/views/test_views_datamanager.py index e36fff8ab..48aa48039 100644 --- a/backend/api/tests/views/test_views_datamanager.py +++ b/backend/api/tests/views/test_views_datamanager.py @@ -75,7 +75,6 @@ def setUp(self): "authorized_ids": ["MyOrg1MSP"], }, }, - "type": "Test", "opener": { "checksum": "dummy-checksum", "storage_address": f"http://testserver/data_manager/{data_manager_1.key}/opener/", @@ -106,7 +105,6 @@ def setUp(self): "authorized_ids": ["MyOrg1MSP"], }, }, - "type": "Test", "opener": { "checksum": "dummy-checksum", "storage_address": f"http://testserver/data_manager/{data_manager_2.key}/opener/", @@ -137,7 +135,6 @@ def setUp(self): "authorized_ids": ["MyOrg1MSP"], }, }, - "type": "Test", "opener": { "checksum": "dummy-checksum", "storage_address": f"http://testserver/data_manager/{data_manager_3.key}/opener/", @@ -377,7 +374,6 @@ def mock_orc_response(data): "json": json.dumps( { "name": "Datamanager test", - "type": "Test", "permissions": { "public": True, "authorized_ids": ["MyOrg1MSP"], @@ -410,7 +406,6 @@ def test_file_size_limit(self): "json": json.dumps( { "name": "Datamanager test", - "type": "Test", "permissions": { "public": True, "authorized_ids": ["MyOrg1MSP"], @@ -447,7 +442,6 @@ def __init__(self) -> None: "json": json.dumps( { "name": "Datamanager test", - "type": "Test", "permissions": { "public": True, "authorized_ids": ["MyOrg1MSP"], From ef536547eaee49475da9fb3fa7d585f734af5ab5 Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Mon, 25 Mar 2024 16:36:04 +0100 Subject: [PATCH 4/5] changelog Signed-off-by: ThibaultFy --- changes/860.changed | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/860.changed diff --git a/changes/860.changed b/changes/860.changed new file mode 100644 index 000000000..6fee439a6 --- /dev/null +++ b/changes/860.changed @@ -0,0 +1 @@ +BREAKING: remove `type` from `datamanager` ([#860](https://github.com/Substra/substra-backend/pull/860/files)) \ No newline at end of file From 84248b1aea88721cee506701398c25ff23915f67 Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Mon, 25 Mar 2024 16:45:52 +0100 Subject: [PATCH 5/5] add gitkeep Signed-off-by: ThibaultFy --- changes/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 changes/.gitkeep diff --git a/changes/.gitkeep b/changes/.gitkeep new file mode 100644 index 000000000..e69de29bb