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

chore!: remove type in DataManager model #860

Merged
merged 5 commits into from
Mar 25, 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
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))
Loading