Skip to content

Commit

Permalink
MRG: Merge pull request #108 from octue/fix/update-manifest-schema
Browse files Browse the repository at this point in the history
Update manifest schema
  • Loading branch information
cortadocodes authored Sep 27, 2022
2 parents cca1bde + 6c92fb6 commit 6edbf6b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 93 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="twined",
version="0.5.0",
version="0.5.1",
py_modules=[],
install_requires=["jsonschema ~= 4.4.0", "python-dotenv"],
url="https://www.github.com/octue/twined",
Expand Down
66 changes: 12 additions & 54 deletions tests/test_manifest_strands.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,31 +121,17 @@ def test_valid_manifest_files(self):
"files": [
{
"path": "configuration/datasets/7ead7669/file_1.csv",
"cluster": 0,
"sequence": 0,
"extension": "csv",
"tags": {},
"labels": [],
"posix_timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86",
"last_modified": "2019-02-28T22:40:30.533005Z",
"name": "file_1.csv",
"size_bytes": 59684813,
"sha-512/256": "somesha"
"timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86"
},
{
"path": "configuration/datasets/7ead7669/file_2.csv",
"cluster": 0,
"sequence": 1,
"extension": "csv",
"tags": {},
"labels": [],
"posix_timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45",
"last_modified": "2019-02-28T22:40:40.633001Z",
"name": "file_2.csv",
"size_bytes": 59684813,
"sha-512/256": "someothersha"
"timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45"
}
]
}
Expand All @@ -165,31 +151,17 @@ def test_valid_manifest_files(self):
"files": [
{
"path": "input/datasets/7ead7669/file_1.csv",
"cluster": 0,
"sequence": 0,
"extension": "csv",
"tags": {},
"labels": [],
"posix_timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86",
"last_modified": "2019-02-28T22:40:30.533005Z",
"name": "file_1.csv",
"size_bytes": 59684813,
"sha-512/256": "somesha"
"timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86"
},
{
"path": "input/datasets/7ead7669/file_2.csv",
"cluster": 0,
"sequence": 1,
"extension": "csv",
"tags": {},
"labels": [],
"posix_timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45",
"last_modified": "2019-02-28T22:40:40.633001Z",
"name": "file_2.csv",
"size_bytes": 59684813,
"sha-512/256": "someothersha"
"timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45"
}
]
},
Expand All @@ -210,31 +182,17 @@ def test_valid_manifest_files(self):
"files": [
{
"path": "input/datasets/7ead7669/file_1.csv",
"cluster": 0,
"sequence": 0,
"extension": "csv",
"tags": {},
"labels": [],
"posix_timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86",
"last_modified": "2019-02-28T22:40:30.533005Z",
"name": "file_1.csv",
"size_bytes": 59684813,
"sha-512/256": "somesha"
"timestamp": 0,
"id": "abff07bc-7c19-4ed5-be6d-a6546eae8e86"
},
{
"path": "input/datasets/7ead7669/file_2.csv",
"cluster": 0,
"sequence": 1,
"extension": "csv",
"tags": {},
"labels": [],
"posix_timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45",
"last_modified": "2019-02-28T22:40:40.633001Z",
"name": "file_2.csv",
"size_bytes": 59684813,
"sha-512/256": "someothersha"
"timestamp": 0,
"id": "bbff07bc-7c19-4ed5-be6d-a6546eae8e45"
}
]
}
Expand Down
77 changes: 39 additions & 38 deletions twined/schema/manifest_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,47 +46,48 @@
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "A file id",
"type": "string"
},
"path": {
"description": "Path at which the file can be found",
"type": "string"
},
"extension": {
"description": "The file extension (not including a '.')",
"type": "string"
},
"sequence": {
"description": "The ordering on the file, if any, within its group/cluster",
"type": [
"integer",
"null"
"oneOf": [
{
"type": "object",
"properties": {
"id": {
"description": "A file id",
"type": "string"
},
"path": {
"description": "Path at which the file can be found",
"type": "string"
},
"timestamp": {
"oneOf": [
{
"description": "A posix based timestamp associated with the file. This may, but need not be, the created or modified time. ",
"type": "number"
},
{
"description": "A posix based timestamp associated with the file. This may, but need not be, the created or modified time. ",
"type": "null"
}
]
},
"tags": {
"$ref": "#/$defs/tags"
},
"labels": {
"$ref": "#/$defs/labels"
}
},
"required": [
"id",
"path",
"timestamp",
"tags",
"labels"
]
},
"cluster": {
"description": "The group, or cluster, to which the file belongs",
"type": "integer"
},
"posix_timestamp": {
"description": "A posix based timestamp associated with the file. This may, but need not be, the created or modified time. ",
"type": "number"
},
"tags": {
"$ref": "#/$defs/tags"
},
"labels": {
"$ref": "#/$defs/labels"
{
"type": "string"
}
},
"required": [
"id",
"path",
"tags",
"labels"
]
}
}
Expand Down

0 comments on commit 6edbf6b

Please sign in to comment.