tonybaloney/Pyjion

Error using Sqlalchemy

daog1 opened this issue · 6 comments

daog1 commented

code:

class Post(Base):
    __tablename__ = 'post'
    id = Column(Integer, autoincrement=True, primary_key=True)
    name = Column(String)
import pyjion
pyjion.enable()
sp =select(Post)
ps = session.execute(select(Post)).scalars().all()

error:

  File "D:/code/pycode/f003/models.py", line 135, in <module>
    sp =select(Post)
  File "<string>", line 2, in select
  File "D:\tools\Python310\lib\site-packages\sqlalchemy\sql\selectable.py", line 5215, in _create
    return cls._create_future_select(*args)
  File "D:\tools\Python310\lib\site-packages\sqlalchemy\sql\selectable.py", line 5140, in _create_future_select
    GenerativeSelect.__init__(self)
TypeError: TraversibleType.__init__() missing 2 required positional arguments: 'bases' and 'clsdict'
python-BaseException

There is no such problem when pyjion is not used
SQLAlchemy~=1.4.27

Which version of Pyjion are you using?

daog1 commented

1.2.0

thanks I can repro this on master. IF you set pyjion.config(level=0) this issue should go away by disabling optimisations as a workaround but I will look for the underlying issue.

daog1 commented

According to your tips, my project is set up so that it can really run. Thank you. I hope you can solve this problem as soon as possible. This project is a good one.

Identified a fix which will ship in 1.2.1 (later today)

1.2.1 is released. please update