mrevutskyi / flask-restless-ng

A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless-ng.readthedocs.io
Other
64 stars 11 forks source link

ImportError: cannot import name 'HYBRID_PROPERTY' from 'sqlalchemy.ext.hybrid' #40

Closed samialfattani closed 1 year ago

samialfattani commented 1 year ago

the following error just raised once the first import of flask_restless!!

ImportError: cannot import name 'HYBRID_PROPERTY' from 'sqlalchemy.ext.hybrid'

if have just used the snippet code that is listed in Quickstart page

any explanation?

mrevutskyi commented 1 year ago

What version of SQLAlchemy do you use?

samialfattani commented 1 year ago

it was SQLAlchemy==2.0.5

and then i updated it into the last version: last version SQLAlchemy==2.0.6

but it didn't work in all cases also i updated Flask, Flask-Sqlalchemy into the last version, but still same error is raising!

here is pip freeze:

click==8.1.3
Flask==2.2.3
Flask-Restless-NG==2.5.0
Flask-SQLAlchemy==3.0.3
greenlet==2.0.2
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.2
python-dateutil==2.8.2
six==1.16.0
SQLAlchemy==2.0.6
typing_extensions==4.5.0
Werkzeug==2.2.3
mrevutskyi commented 1 year ago

Thank you for the report and for the additional info. It has only been tested with SQLAlchemy 1.x I was able to reproduce your issue with 2.0.6. Will try so post a fix soon-ish

mrevutskyi commented 1 year ago

I took a quick look and adding support for SQLAlchemy 2.0 would require some major changes and will break compatibility with 1.3-1.4, and will be added in flask-restless-ng 3.0. But that would take some time For now I have restricted SQLAlchemy version to >=1.3,<2.0

mrevutskyi commented 1 year ago

Fixed in version 3.0.0