-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #387 from bento-platform/features/typed-extra-prop…
…erties Features/typed extra properties
- Loading branch information
Showing
24 changed files
with
800 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ config.json | |
|
||
# MacOS | ||
.DS_Store | ||
|
||
tmp/ | ||
chord_metadata_service/vrs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 4.2 on 2023-05-11 19:39 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('chord', '0004_v2_14_0'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ProjectJsonSchema', | ||
fields=[ | ||
('id', models.CharField(default=uuid.uuid4, editable=False, max_length=200, primary_key=True, serialize=False)), | ||
('required', models.BooleanField(default=False, help_text='Determines if the extra_properties field is required or not.')), | ||
('json_schema', models.JSONField()), | ||
('schema_type', models.CharField(choices=[('PHENOPACKET', 'Phenopacket'), ('BIOSAMPLE', 'Biosample'), ('INDIVIDUAL', 'Individual')], max_length=200)), | ||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_schemas', to='chord.project')), | ||
], | ||
), | ||
migrations.AddConstraint( | ||
model_name='projectjsonschema', | ||
constraint=models.UniqueConstraint(fields=('project', 'schema_type'), name='unique_project_schema'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from uuid import uuid4 | ||
from django.test import TestCase | ||
from chord_metadata_service.chord.data_types import DATA_TYPE_PHENOPACKET | ||
|
||
from chord_metadata_service.chord.models import Dataset, Project, Table, TableOwnership | ||
from chord_metadata_service.chord.tests.constants import VALID_DATA_USE_1 | ||
|
||
|
||
class ProjectTestCase(TestCase): | ||
""" | ||
Helper TransactionTestCase class that creates a Project, Dataset, TableOwnership and Table. | ||
Data is created once for the whole test case at the class level | ||
""" | ||
|
||
@classmethod | ||
def setUpTestData(cls) -> None: | ||
cls.project = Project.objects.create(title="Project 1", description="") | ||
cls.dataset = Dataset.objects.create( | ||
title="Dataset 1", | ||
description="Some dataset", | ||
data_use=VALID_DATA_USE_1, | ||
project=cls.project | ||
) | ||
cls.table_ownership = TableOwnership.objects.create( | ||
table_id=str(uuid4()), | ||
service_id=str(uuid4()), | ||
service_artifact="variant", | ||
dataset=cls.dataset | ||
) | ||
cls.table = Table.objects.create( | ||
ownership_record=cls.table_ownership, | ||
name="Table 1", | ||
data_type=DATA_TYPE_PHENOPACKET | ||
) | ||
return super().setUpTestData() |
Oops, something went wrong.