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

Stale table cache casues incorrect results #67

Closed
gregnavis opened this issue Jan 17, 2014 · 0 comments
Closed

Stale table cache casues incorrect results #67

gregnavis opened this issue Jan 17, 2014 · 0 comments

Comments

@gregnavis
Copy link
Contributor

The following code snippet demonstrates the issue:

import dataset

db = dataset.connect('sqlite:///:memory:')

# We create test_table and insert a single row into it
t1 = db.get_table('test_table')
t1.insert(dict(key='value'))

# We access the table with a different Table object and we cannot see the
# property named key that we added above
t2 = db.get_table('test_table')
print list(t2.all()) # [OrderedDict([(u'id', 1)])]

The problem occurs only when accessing the data through two different Table objects.

PS I cheated a little bit because added break at the end of the loop in Table.find - without it Table.all() never returns. However the problem described above appears in the version uploaded to PyPI too.

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 a pull request may close this issue.

1 participant