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

Fix: Circular reference detected error #332

Merged
merged 3 commits into from
Sep 12, 2018

Conversation

bratomes
Copy link
Contributor

Problem

I got the error ValueError: Circular reference detected when trying to get a Record instance representation of records lib.

Solution

My table has a uuid type field. This type is not JSON serializable, so needs to be handled (converted to str).

Maybe this fix kennethreitz/records#95.

Error scenario

Create database with a uuid field

create table bar (                                                      
    id serial primary key,
    foo_id uuid
);

Insert data

insert into bar (foo_id) values ('30fcb0c7-a836-446c-9c88-411800c0c818')

Use records lib and get the error

In [1]: import records
In [2]: db = records.Database('postgres://...')
In [3]: rows = db.query('select * from bar')
In [4]: rows[0]
...
ValueError: Circular reference detected

@iurisilvio iurisilvio merged commit 3d5943a into jazzband:master Sep 12, 2018
@dschep
Copy link

dschep commented Oct 25, 2018

Hey @kennethreitz, any chance of this change being released to PyPI?

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

Successfully merging this pull request may close these issues.

circular reference detected for minimal query
3 participants