linkyndy/remodel

KeyError when creating tables

jamorton opened this issue · 4 comments

when running remodel.utils.create_tables(), I get the folllowing error:

Traceback (most recent call last):
  File "./manage.py", line 4, in <module>
    from mzk import app
  File "/Users/jamorton/dev/mzk2/mzk/__init__.py", line 11, in <module>
    remodel.utils.create_tables()
  File "/Users/jamorton/dev/mzk2/env/lib/python3.4/site-packages/remodel/utils.py", line 19, in create_tables
    if result['created'] != 1:
KeyError: 'created'

Using python 3.4, rethinkdb 1.16.0-1 (python package rethinkdb 1.16.0-2), and remodel 0.3.0.

I think this is because the key should actually be "tables_created", not "created", according to http://rethinkdb.com/api/javascript/table_create/

Correct, there´s a pull request addressing this pending. Also, noticed an error in the official release notes https://github.com/rethinkdb/rethinkdb/releases/tag/v1.16.0-1 stating the new key as "tables_creates" which is a typo. Good to know

Tomorrow remodel v0.3.1 will be up and running containing @Gesias's fix.

Remodel v0.3.1 is out now, thanks @Gesias for contributing!

Will leave this issue open until I manage to make wercker install the latest version of RethinkDB (this is why the build is red -- Remodel works fine with RethinkDB 1.16.0!).

Forked the RethinkDB wercker box and remodel build is green now.