Skip to content

[peewee] using Model.get_or_create() doesn't work with pgvector #31

Closed
@ricardofunke

Description

@ricardofunke

Hello!

I'm trying to use the peewee method .get_or_create() in place of .create() but I'm getting the following error:

{...}
  File "/myprj/venv/lib/python3.11/site-packages/pgvector/peewee/__init__.py", line 16, in db_value
    return to_db(value)
           ^^^^^^^^^^^^
  File "/myprj/venv/lib/python3.11/site-packages/pgvector/utils/__init__.py", line 37, in to_db
    return '[' + ','.join([str(float(v)) for v in value]) + ']'
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object is not iterable

Can you help to find out whether is this a bug or something I'm doing wrong?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions