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

Metadata as class<str> after saving empty metadata #324

Closed
PolinaBevad opened this issue Mar 27, 2020 · 2 comments
Closed

Metadata as class<str> after saving empty metadata #324

PolinaBevad opened this issue Mar 27, 2020 · 2 comments

Comments

@PolinaBevad
Copy link
Contributor

I’m not sure if it is a bug or not: if I save empty metadata to an object (and metadata’s type is dict), then next time when I try to get this metadata, it’s type will be str. Code to reproduce:

folder = Object.retrieve(some_id_here) 
metadata = {}
print(type(metadata)) # <class 'dict'>
folder.metadata = metadata
folder.save() 
metadata = folder.metadata
print(type(metadata))  # <class 'str'>

Found this when was copying metadata from parent folder and it was empty.

@jsh2134
Copy link
Contributor

jsh2134 commented Aug 6, 2020

Yes this is an API bug. We use a JSON Field for the metadata and technically "" is valid JSON. It should be fixed to return {}

@davecap
Copy link
Member

davecap commented Oct 14, 2020

Confirming that this has been fixed in the API. The API now returns {} which is loaded by the client as type SolveObject.

@davecap davecap closed this as completed Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants