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

gourmet 1.0.0 doesn't work with sqlalchemy 1.4 #79

Closed
marillat opened this issue Dec 6, 2021 · 3 comments
Closed

gourmet 1.0.0 doesn't work with sqlalchemy 1.4 #79

marillat opened this issue Dec 6, 2021 · 3 comments

Comments

@marillat
Copy link
Contributor

marillat commented Dec 6, 2021

Debian unstable amd64
python3-sqlalchemy 1.4.23+ds1-5 (works fine with python3-sqlalchemy 1.3.22+ds1-1)

Traceback (most recent call last):
  File "/usr/bin/gourmand", line 33, in <module>
    sys.exit(load_entry_point('gourmand==1.0.0', 'gui_scripts', 'gourmand')())
  File "/usr/lib/python3/dist-packages/gourmand/main.py", line 617, in launch_app
    RecGui.instance()
  File "/usr/lib/python3/dist-packages/gourmand/main.py", line 837, in instance
    RecGui.__single = cls()
  File "/usr/lib/python3/dist-packages/gourmand/main.py", line 846, in __init__
    GourmandApplication.__init__(self)
  File "/usr/lib/python3/dist-packages/gourmand/main.py", line 69, in __init__
    self.setup_recipes() # Setup recipe database
  File "/usr/lib/python3/dist-packages/gourmand/main.py", line 146, in setup_recipes
    self.rd = recipeManager.default_rec_manager()
  File "/usr/lib/python3/dist-packages/gourmand/recipeManager.py", line 84, in default_rec_manager
    return get_recipe_manager(**dbargs)
  File "/usr/lib/python3/dist-packages/gourmand/recipeManager.py", line 81, in get_recipe_manager
    return RecipeManager.instance_for(**kwargs)
  File "/usr/lib/python3/dist-packages/gourmand/backends/db.py", line 1861, in instance_for
    cls._instance_by_db_url[url] = cls(file, custom_url)
  File "/usr/lib/python3/dist-packages/gourmand/backends/db.py", line 1868, in __init__
    self.km = KeyManager.instance(recipe_manager=self)
  File "/usr/lib/python3/dist-packages/gourmand/keymanager.py", line 22, in instance
    KeyManager.__single = cls(recipe_manager)
  File "/usr/lib/python3/dist-packages/gourmand/keymanager.py", line 32, in __init__
    if self.rm.fetch_len(self.rm.keylookup_table) == 0:
  File "/usr/lib/python3/dist-packages/gourmand/backends/db.py", line 759, in fetch_len
    return table.count().execute().fetchone()[0]
AttributeError: 'Table' object has no attribute 'count'
@marillat
Copy link
Contributor Author

marillat commented Dec 6, 2021

I forgot, table.count() has been deprecated in sqlalchemy 1.1 and removed in 1.4

@cydanil
Copy link
Contributor

cydanil commented Dec 7, 2021

Thanks for bringing it to my attention.
I previously pinned sqlalchemy to 1.3.22 (the last 1.3 release) because of this.
I would welcome a PR if you feel like solving this 🙂

@marillat
Copy link
Contributor Author

Why to not ask for help to sqlalchemy people ?
https://github.com/sqlalchemy/sqlalchemy/discussions

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