catherinedevlin / ipython-sql

%%sql magic for IPython, hopefully evolving into full SQL client
MIT License
1.79k stars 368 forks source link

Pretty table config is deprecated and it causes an error of `KeyError: "DEFAULT"` #252

Open talbarda opened 2 weeks ago

talbarda commented 2 weeks ago

https://github.com/catherinedevlin/ipython-sql/blob/eb274844b4a619463149e0d57df705e1bba47635/src/sql/run.py#L116C63-L116C74

description in https://github.com/catherinedevlin/ipython-sql/blob/eb274844b4a619463149e0d57df705e1bba47635/src/sql/run.py#L116C63-L116C74 it'd relying on old values which were deprecated in https://github.com/prettytable/prettytable/commit/c280f5db3889e5e7857661d6e42dd07c8d7a6d77#diff-a23434b1b73f48b3a86c77a98ace18042f475a7463f98eea9d2ccf7523e6046dL13 (see https://github.com/prettytable/prettytable/releases)

few possible solutions:

  1. change to self.pretty = PrettyTable(self.field_names, style=prettytable.__dict__[f"_DEPRECATED_{config.style.upper()}])
  2. freeze prettytable to 3.11 in https://github.com/catherinedevlin/ipython-sql/blob/eb274844b4a619463149e0d57df705e1bba47635/requirements.txt#L1