ITC-CRIB / fairly

A package to create, publish, and clone research datasets

Home Page:https://fairly.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot represent as object a 'Contributor' with Role 'Other'

c-martinez opened this issue · comments

I'm trying fairly, just to get familiar with the tool. I tried to use it download some files from Zenodo, and ran into the following error:

ruamel.yaml.representer.RepresenterError: cannot represent an object: {..., 'role': 'Other'}

I think it due to the metadata in the Zenodo record not being handled properly, specifically it seems like contributors are causing the issue.

The following lines should be sufficient to reproduce the error:

import fairly

doi = "https://doi.org/10.5281/zenodo.1494140"
downloadDir = 'download/'

dataset = fairly.dataset(doi)
local_dataset = dataset.store(downloadDir)

Could you tell me if you install fairly from PyPI or from source?

From PyPI pip install fairly

Hello Carlos,
I tried to reproduce the error. But I don't see it. I tried the PyPI version and the source version. Does the error appear at the beginning of the download or in the middle? In my attempt to reproduce the error, I see the manifest file is written, and the data start downloading.

Can you confirm that the error appears for other Zenodo datasets?
What Python version are you using?

Is this what you would expect on Contributors?:

  contributors:
  - fullname: de Kruif, Jose
    surname: de Kruif
    name: Jose
    institution: Utrecht Digital Humanities Lab
    role: Other
  - fullname: Gonggrijp, Julian
    surname: Gonggrijp
    name: Julian
    institution: Utrecht Digital Humanities Lab
    role: Other

Hello @manuGil !

The error appears at the beginning of the download (as far as I can tell). A manifest file is created, but it is empty. I tried with a different dataset, but that one worked.

I tried on a different machine, and it worked there, so I tracked the bug down, it seems to be that the difference is in versions of python and ruamel.yaml versions:

  • Python 3.9, ruamel.yaml==0.17.26 ==> worked
  • Python 3.10.8, ruamel.yaml==0.17.21 ==> failed

So probably it is an issue with the version of ruamel.yaml?

Hello @c-martinez ,

Thanks for tracking the issue down. I will take note of the incompatibility with that version of ramuel and document it.