Closed dmelichar closed 3 years ago
This also seems to be a probem with Dataset objects. I tried to create a new Dataset with the demo file dataset-finch1-json
and upload it. Same setup and context as before.
ds1 = Dataset()
with open(dataset1) as df:
ds1.from_json(df.read())
resp = napi.create_dataset(dataverse=alias, metadata=ds1.to_json())
print(resp.text)
The error thrown is:
FileNotFoundError: [Errno 2] No such file or directory: 'schemas/json/dataset_upload_default_schema.json'
Facing this issue, any workaround?
@memetics19 yes, if you deactivate validation, the missing schema file is not called. e.g. .to_json(validate=False)
. But i will try to fix it in the next days.
@dmelichar do you know, how you installed pyDataverse? I have checked, and the file is in the respective place inside the repo, but it is in the repo root directory. So my first guess is, cause the path is relative, that it must be inside the pydataverse folder src/pyDataverse/
. So depending on how you install the package, it maybe is not using the repo root as the current working directory or it looks for it inside the src/pyDataverse
directory, which only holds the Python files.
Fix: 6c53b0f
Expected Behavior
It should be possible to create an Dataverse object from a JSON file, such as this example file.
Current Behavior
The following error is thrown:
Possible Solution
Include Dataverse schema
Steps to Reproduce
Context (Environment
Branch - develop Commit hash - 3b040ff23b665ec2650bebcf4bd5478de6881af0 Environment - macOS using Pipenv