pyeve / eve-sqlalchemy

SQLAlchemy data layer for Eve-powered RESTful APIs
http://eve-sqlalchemy.readthedocs.io
Other
232 stars 70 forks source link

eve_sqlalchemy does not work with sqlalchemy v0.8 #63

Closed kalombos closed 7 years ago

kalombos commented 9 years ago

The line

from eve_sqlalchemy.decorators import registerSchema

raises an exception:

  File "/home/kalombo/.virtualenvs/dev/local/lib/python2.7/site-packages/eve_sqlalchemy/decorators.py", line 30, in <module>
    sqlalchemy.dialects.postgresql.JSON: 'json'}
AttributeError: 'module' object has no attribute 'JSON'

because sqlalchemy v0.8 does not support JSON for postgresql yet. Tested on SQLAlchemy==0.8.3

goneri commented 9 years ago

Thanks @kalombos for the bug report.

Indeed sqlalchemy.dialects.postgresql.JSON has been introduced in SQLAlchemy 0.9.0.

We can either bump the minimal SQLAlchemy version to 0.9.0 or do a try/except to disable the Pg JSON support is SQLAlchemy is too old. @nicolaiarocci, what do you prefer?

amleczko commented 9 years ago

I would prefer to use >0.9 as it was released in March 2013, more or less when python-eve was released ;-)

goneri commented 9 years ago

So we need a try/expect to catch the exception. @amleczko You should keep the bug opened :-).

amleczko commented 9 years ago

Well instead of try-except I would pin the sqlalchemy to >0.9 but I agree it should be added.