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

tuple() properties should be supported #46

Open
phorward opened this issue Feb 9, 2024 · 2 comments
Open

tuple() properties should be supported #46

phorward opened this issue Feb 9, 2024 · 2 comments

Comments

@phorward
Copy link
Member

phorward commented Feb 9, 2024

Trying to write a tuple to the datastore fails with this:

[2024-02-09 19:24:17,825] /.../viur/core/request.py:424 [ERROR] Deferred Task emulation <function History._writeToDatastore at 0x70c7b40fb1a0> failed
Traceback (most recent call last):
  File "~/viur-core/src/viur/core/request.py", line 422, in _process
    task()
  File "~/viur-core/src/viur/core/tasks.py", line 541, in task
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/myproject/deploy/modules/history.py", line 87, in _writeToDatastore
    assert skel.toDB()
           ^^^^^^^^^^^
  File "~/viur-core/src/viur/core/skeleton.py", line 1143, in toDB
    bone.postSavedHandler(skel, bone_name, key)
  File "~/viur-core/src/viur/core/bones/relational.py", line 623, in postSavedHandler
    db.Put(dbObj)
  File "src/viur/datastore/transport.pyx", line 733, in viur.datastore.transport.Put
  File "src/viur/datastore/transport.pyx", line 207, in viur.datastore.transport.pythonPropToJson
  File "src/viur/datastore/transport.pyx", line 237, in viur.datastore.transport.pythonPropToJson
AssertionError: ('key', 'name', 'firstname', 'lastname') (<class 'tuple'>) is not supported
@ArneGudermann
Copy link
Contributor

I think this is not possible because the datastore not accepted a tuple or a set.
https://cloud.google.com/datastore/docs/reference/data/rest/Shared.Types/Value

@skoegl
Copy link
Member

skoegl commented Feb 29, 2024

ack, please convert the tuple of foo to list of foo

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