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

prettytable new version 3.12.0 is conflicting #1038

Closed
TheoLeg opened this issue Oct 30, 2024 · 8 comments · Fixed by #1039
Closed

prettytable new version 3.12.0 is conflicting #1038

TheoLeg opened this issue Oct 30, 2024 · 8 comments · Fixed by #1039

Comments

@TheoLeg
Copy link

TheoLeg commented Oct 30, 2024

What happens?

prettytable package new version (3.12.0) is conflicting with jupysql current version.

To Reproduce

requirements :
jupysql==0.10.14
jupysql-plugin==0.4.5
prettytable==3.12.0
snowflake-sqlalchemy==1.6.1
SQLAlchemy==1.4.54

from sqlalchemy import create_engine
from snowflake.sqlalchemy import URL

engine = create_engine(URL(
    account = '<account>,
    user = <user>,
    authenticator='externalbrowser'
))
%load_ext sql
%sql engine
%sql SELECT * FROM DATABASE.SCHEMA.TABLE LIMIT 10

Error :


KeyError Traceback (most recent call last)
Cell In[7], line 1
----> 1 get_ipython().run_line_magic('sql', 'SELECT * FROM DATABASE.SCHEMA.TABLE LIMIT 10')

--> [466] _style = prettytable.dict[self._config.style.upper()]
[467] pretty.set_style(_style)
[469] return pretty

KeyError: 'DEFAULT'

To fix : Downgrade to previous version of prettytable (3.10.2) and it's working again

OS:

macOS

JupySQL Version:

0.10.14

Full Name:

Theo Legruel

Affiliation:

April

@TheoLeg TheoLeg changed the title prettytable new version 3.12.0 prettytable new version 3.12.0 is conflicting Oct 30, 2024
@dereksz
Copy link

dereksz commented Oct 30, 2024

Confirming I have the same issue; Linux, JupySQL 0.10.14.

Can be avoided by pip install prettytable<3.12.0.

Digging into the prettytable.__dict__, the "DEFAULT" key is gone, replaced with "_DEPRECATED_DEFAULT".

Can simply be recreated with:

%sql sqlite://
%sql SELECT 1

@rlshuhart
Copy link

To round out the OS's, can also confirm issue on Windows OS. Downgrading prettytable also fixes. Thanks @TheoLeg for taking the time to create issue.

@edublancas
Copy link

I've fixed this in 0.10.15, note that this update is no longer compatible with Python 3.8 since prettytable 3.12.0 deprecated support. so you'll have to use prettytable<3.12.0 and jupysql<0.10.15 if you are using python 3.8

@lukebarousse
Copy link

Out of curiosity, how long until this is updated on conda-forge? It's still on version 0.10.14 there.

CleanShot 2024-11-06 at 13 50 03

Background: I'm making a course using this tool, and we work in a conda environment.

@edublancas
Copy link

@lukebarousse the auto-generated conda recipe is broken (conda-forge/jupysql-feedstock#34). @flaviomartins is kindly helping fix it. I'd appreciate if you can give it a check/test. I'll review it in the next few days so I'm hoping this to go live this week

@lukebarousse
Copy link

@edublancas, thanks for the update, and I appreciate the quick turnaround! This library is a life-saver 🙌

@flaviomartins
Copy link

Out of curiosity, how long until this is updated on conda-forge? It's still on version 0.10.14 there.

CleanShot 2024-11-06 at 13 50 03

Background: I'm making a course using this tool, and we work in a conda environment.

Same. You might want to have a look at the environment I created for my course at https://github.com/bdist/bdist-workspace

@lukebarousse
Copy link

Same. You might want to have a look at the environment I created for my course at https://github.com/bdist/bdist-workspace

Sweet! Thanks for sharing this; I like how you used docker for this, looks like this solves a lot of headaches.

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

Successfully merging a pull request may close this issue.

6 participants