Skip to content

Commit

Permalink
chore!: remove type in DataManager model (#860)
Browse files Browse the repository at this point in the history

Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy authored Mar 25, 2024
1 parent 1f61a54 commit 0f2349c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
16 changes: 16 additions & 0 deletions backend/api/migrations/0059_remove_datamanager_type.py
Original file line number Diff line number Diff line change
@@ -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",
),
]
1 change: 0 additions & 1 deletion backend/api/models/datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion backend/api/serializers/datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Meta:
"opener",
"owner",
"permissions",
"type",
]

def to_representation(self, instance):
Expand Down
2 changes: 0 additions & 2 deletions backend/api/tests/asset_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 0 additions & 6 deletions backend/api/tests/views/test_views_datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down Expand Up @@ -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/",
Expand Down Expand Up @@ -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/",
Expand Down Expand Up @@ -377,7 +374,6 @@ def mock_orc_response(data):
"json": json.dumps(
{
"name": "Datamanager test",
"type": "Test",
"permissions": {
"public": True,
"authorized_ids": ["MyOrg1MSP"],
Expand Down Expand Up @@ -410,7 +406,6 @@ def test_file_size_limit(self):
"json": json.dumps(
{
"name": "Datamanager test",
"type": "Test",
"permissions": {
"public": True,
"authorized_ids": ["MyOrg1MSP"],
Expand Down Expand Up @@ -447,7 +442,6 @@ def __init__(self) -> None:
"json": json.dumps(
{
"name": "Datamanager test",
"type": "Test",
"permissions": {
"public": True,
"authorized_ids": ["MyOrg1MSP"],
Expand Down
Empty file added changes/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions changes/860.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BREAKING: remove `type` from `datamanager` ([#860](https://github.com/Substra/substra-backend/pull/860/files))

0 comments on commit 0f2349c

Please sign in to comment.