Skip to content

Commit

Permalink
compound not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-pol committed Nov 28, 2023
1 parent 634a24e commit f41e136
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/datastation/dataverse/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ def __init__(self, dataverse_client: DataverseClient, dry_run: bool = False):
def update_metadata(self, data: dict):
logging.debug(data)
all_fields = []
if '@' in ' '.join(data.keys()):
raise Exception("Compound fields not supported")
for key in [key for key in data.keys() if key != 'PID' and not data[key].startswith('[')]:
all_fields.append({'typeName': key, 'value': data[key]})
for key in [key for key in data.keys() if key != 'PID' and data[key].startswith('[')]:
logging.debug('-------' + data[key] + '=======')
all_fields.append({'typeName': key, 'value': json.loads(data[key])})
logging.debug(all_fields)
dataset_api = self.dataverse_client.dataset(data['PID'])
Expand Down

0 comments on commit f41e136

Please sign in to comment.