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

Cosima cookbook does not import with sqlalchemy 2 #320

Open
dsroberts opened this issue Feb 2, 2023 · 2 comments
Open

Cosima cookbook does not import with sqlalchemy 2 #320

dsroberts opened this issue Feb 2, 2023 · 2 comments

Comments

@dsroberts
Copy link

Hi All

Just attempted a test hh5 update, ran a notebook and got this:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 3
      1 get_ipython().run_line_magic('matplotlib', 'inline')
----> 3 import cosima_cookbook as cc
      4 import matplotlib.pyplot as plt
      5 import numpy as np

File /scratch/v45/dr4292/conda_tmp/envs/analysis3-22.10/lib/python3.9/site-packages/cosima_cookbook/__init__.py:9
      6 import pkg_resources
      8 from . import database
----> 9 from . import querying
     10 from . import explore
     12 try:

File /scratch/v45/dr4292/conda_tmp/envs/analysis3-22.10/lib/python3.9/site-packages/cosima_cookbook/querying.py:12
     10 from sqlalchemy import func, distinct, or_
     11 from sqlalchemy.orm import aliased
---> 12 from sqlalchemy.sql.selectable import subquery
     13 import warnings
     14 import xarray as xr

ImportError: cannot import name 'subquery' from 'sqlalchemy.sql.selectable' (/scratch/v45/dr4292/conda_tmp/envs/analysis3-22.10/lib/python3.9/site-packages/sqlalchemy/sql/selectable.py)

Can confirm it works fine with sqlalchemy 1.4.46.

@angus-g
Copy link
Collaborator

angus-g commented Feb 2, 2023

I don't know if subquery is even actually used, not sure why we have that import! (something something lint unused imports...)

@dougiesquire
Copy link
Collaborator

I don't think that the import of subquery is the only issue. After removing this, most of the tests error out with:

sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: 'PRAGMA user_version'

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

3 participants