Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using edit_dataset_metadata: multiple values for keyword argument 'json' #216

Open
vera opened this issue Jan 15, 2025 · 2 comments
Labels
status:incoming Newly created issue to be forwarded type:bug Something isn't working
Milestone

Comments

@vera
Copy link

vera commented Jan 15, 2025

When using edit_dataset_metadata, I get the following error:

    edit_res = dataverse_api.edit_dataset_metadata(resource_id, json.dumps(metadata))
  File "/home/clemens/Documents/csh-ui/backend/.venv/lib/python3.10/site-packages/pyDataverse/api.py", line 1548, in edit_dataset_metadata
    resp = self.put_request(url, metadata, auth, params)
  File "/home/clemens/Documents/csh-ui/backend/.venv/lib/python3.10/site-packages/pyDataverse/api.py", line 326, in put_request
    return self._sync_request(
TypeError: pyDataverse.api.Api._sync_request() got multiple values for keyword argument 'json'

Here's my code:

    dataverse_api = NativeApi(DATAVERSE_URL, DATAVERSE_API_TOKEN)
    metadata = {"fields": [{"typeName": "testField", "value": "testValue"}]}
    edit_res = dataverse_api.edit_dataset_metadata(resource_id, json.dumps(metadata))

Not sure if it's a bug or user error. Using pyDataverse v0.3.4

@vera vera added status:incoming Newly created issue to be forwarded type:bug Something isn't working labels Jan 15, 2025
@JR-1991
Copy link
Member

JR-1991 commented Jan 16, 2025

@vera, thank you for reporting the issue! This is definitely a bug, and I have already resolved it in a separate branch. I’m currently adding tests to ensure it gets checked in the future. I will inform you here once the fix is live.

@JR-1991 JR-1991 moved this to In Progress in PyDataverse Working Group Jan 16, 2025
@JR-1991 JR-1991 added this to the 0.3.5 milestone Jan 16, 2025
@vera
Copy link
Author

vera commented Jan 16, 2025

Thanks, that's great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:incoming Newly created issue to be forwarded type:bug Something isn't working
Projects
Status: In Progress
Development

No branches or pull requests

2 participants