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

AttributeError: module 'sqlalchemy.sql.base' has no attribute 'ImmutableColumnCollection' #473

Open
christophscheuch opened this issue Apr 12, 2023 · 1 comment

Comments

@christophscheuch
Copy link

I tried to replicate the minimal example from the website using an in-memory SQLite database:

from siuba import _, tbl, group_by, filter
from siuba.data import cars

# setup ----
from sqlalchemy import create_engine

engine = create_engine("sqlite:///:memory:")
cars.to_sql("cars", engine, index=False)

# analysis ----
(tbl(engine, "cars")
    >> group_by(_.cyl)
    >> filter(_.mpg < _.mpg.mean())
)

I get the following error:

AttributeError: module 'sqlalchemy.sql.base' has no attribute 'ImmutableColumnCollection'

Also the direct import does not work as this chunk

from sqlalchemy.sql.base import ImmutableColumnCollection

returns

ImportError: cannot import name 'ImmutableColumnCollection' from 'sqlalchemy.sql.base'

I guess it is related to this recent commit where they renamend it to ReadOnlyColumnCollection:
sqlalchemy/sqlalchemy@4e754a8#diff-31621fcf3d90e3d9b15029c8dc1ccbf0b7c9f320a0d04471ec0e68ae02e4ec78L1502

I'm sorry in case I miss something completely obvious. I just discovered siuba and found it appealing as an experienced R, but unfortunately I did not get far yet :(

@GitHunter0
Copy link

@christophscheuch , it is because siuba is using an old version of sqlalchemy package.
Try installing version 1.4.32 (pip install sqlalchemy==1.4.32). For me, that worked.

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

No branches or pull requests

2 participants