Skip to content

Commit

Permalink
Fix issue: topicClassVocabURI missing (#126)
Browse files Browse the repository at this point in the history
The topicClassVocabURI was not used by models.py, which
lead to not importing or exporting the variable.

Resolves: #126
  • Loading branch information
skasberger committed Apr 6, 2021
1 parent bbbbc86 commit c280249
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pyDataverse/models.py
Expand Up @@ -402,7 +402,11 @@ class Dataset(DVObject):
],
"software": ["softwareName", "softwareVersion"],
"timePeriodCovered": ["timePeriodCoveredStart", "timePeriodCoveredEnd"],
"topicClassification": ["topicClassValue", "topicClassVocab"],
"topicClassification": [
"topicClassValue",
"topicClassVocab",
"topicClassVocabURI",
],
}
__attr_import_dv_up_geospatial_fields_values = ["geographicUnit"]
__attr_import_dv_up_geospatial_fields_arrays = {
Expand Down
6 changes: 6 additions & 0 deletions tests/data/dataset_upload_full_default.json
Expand Up @@ -192,6 +192,12 @@
"multiple": false,
"typeClass": "primitive",
"value": "Topic Classification Vocabulary"
},
"topicClassVocabURI": {
"typeName": "topicClassVocabURI",
"multiple": false,
"typeClass": "primitive",
"value": "https://topic.class/vocab/uri"
}
}
]
Expand Down
3 changes: 3 additions & 0 deletions tests/models/test_dataset.py
Expand Up @@ -148,6 +148,7 @@ def dict_flat_set_full():
{
"topicClassValue": "Topic Class Value1",
"topicClassVocab": "Topic Classification Vocabulary",
"topicClassVocabURI": "https://topic.class/vocab/uri",
}
],
"publication": [
Expand Down Expand Up @@ -395,6 +396,7 @@ def object_data_full():
{
"topicClassValue": "Topic Class Value1",
"topicClassVocab": "Topic Classification Vocabulary",
"topicClassVocabURI": "https://topic.class/vocab/uri",
}
],
"publication": [
Expand Down Expand Up @@ -615,6 +617,7 @@ def dict_flat_get_full():
{
"topicClassValue": "Topic Class Value1",
"topicClassVocab": "Topic Classification Vocabulary",
"topicClassVocabURI": "https://topic.class/vocab/uri",
}
],
"publication": [
Expand Down

0 comments on commit c280249

Please sign in to comment.