Skip to content

Commit

Permalink
IMP: Change tags serialisation to a list of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Apr 21, 2021
1 parent 2c580c9 commit d443e22
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/data/apps/example_app/twine.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{
"key": "production_data",
"purpose": "A dataset containing production data",
"tags": "production, wind"
"tags": ["production", "wind"]
}
],
"output_values_schema": {
Expand Down
18 changes: 9 additions & 9 deletions tests/test_manifest_strands.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def test_valid_manifest_files(self):
{
"id": "34ad7669-8162-4f64-8cd5-4abe92509e17",
"name": "my configuration dataset",
"tags": "the, config, tags",
"tags": ["the", "config", "tags"],
"files": [
{
"path": "configuration/datasets/7ead7669/file_1.csv",
"cluster": 0,
"sequence": 0,
"extension": "csv",
"tags": "",
"tags": [],
"posix_timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86",
"last_modified": "2019-02-28T22:40:30.533005Z",
Expand All @@ -82,7 +82,7 @@ def test_valid_manifest_files(self):
"cluster": 0,
"sequence": 1,
"extension": "csv",
"tags": "",
"tags": [],
"posix_timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45",
"last_modified": "2019-02-28T22:40:40.633001Z",
Expand All @@ -103,14 +103,14 @@ def test_valid_manifest_files(self):
{
"id": "7ead7669-8162-4f64-8cd5-4abe92509e17",
"name": "my meteorological dataset",
"tags": "met, mast, wind",
"tags": ["met", "mast", "wind"],
"files": [
{
"path": "input/datasets/7ead7669/file_1.csv",
"cluster": 0,
"sequence": 0,
"extension": "csv",
"tags": "",
"tags": [],
"posix_timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86",
"last_modified": "2019-02-28T22:40:30.533005Z",
Expand All @@ -123,7 +123,7 @@ def test_valid_manifest_files(self):
"cluster": 0,
"sequence": 1,
"extension": "csv",
"tags": "",
"tags": [],
"posix_timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45",
"last_modified": "2019-02-28T22:40:40.633001Z",
Expand All @@ -144,14 +144,14 @@ def test_valid_manifest_files(self):
{
"id": "1ead7669-8162-4f64-8cd5-4abe92509e17",
"name": "my output dataset",
"tags": "the, output, tags",
"tags": ["the", "output", "tags"],
"files": [
{
"path": "input/datasets/7ead7669/file_1.csv",
"cluster": 0,
"sequence": 0,
"extension": "csv",
"tags": "",
"tags": [],
"posix_timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86",
"last_modified": "2019-02-28T22:40:30.533005Z",
Expand All @@ -164,7 +164,7 @@ def test_valid_manifest_files(self):
"cluster": 0,
"sequence": 1,
"extension": "csv",
"tags": "",
"tags": [],
"posix_timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45",
"last_modified": "2019-02-28T22:40:40.633001Z",
Expand Down
15 changes: 13 additions & 2 deletions twined/schema/manifest_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
},
"tags": {
"description": "Textual tags associated with the dataset",
"type": "string"
"type": "array",
"items": [
{
"type": "string"
}
]
},
"files": {
"description": "Textual tags associated with the manifest",
Expand Down Expand Up @@ -67,7 +72,13 @@
"type": "number"
},
"tags": {
"description": "Textual tags associated with the file"
"description": "Textual tags associated with the file",
"type": "array",
"items": [
{
"type": "string"
}
]
}
},
"required": [
Expand Down
8 changes: 6 additions & 2 deletions twined/schema/twine_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@
},
"tags": {
"description": "Comma separated tags that will be applied to the dataset when created",
"type": "string",
"default": ""
"type": "array",
"items": [
{
"type": "string"
}
]
}
},
"required": ["key"]
Expand Down

0 comments on commit d443e22

Please sign in to comment.