-
Notifications
You must be signed in to change notification settings - Fork 608
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
fix(ux): get rid of duplicated tracebacks #10002
Conversation
This fixes the triplicate expression repring in the console and reduces the number of tracebacks rendered by one in the notebook (via quarto), so there's still two there. I'm going to poke at it in jupyterlab to see if it's a quarto rendering issue, or it's something in jupyter. |
c3ee442
to
77220bf
Compare
There is Here's the issue: When both Possible solutionsDefine only
|
I can also bring back |
cfa6be9
to
9ab3590
Compare
Naturally, something is cursed here. |
9ab3590
to
a4cee6e
Compare
Not sure what was happening but something in the commit from #9811 was causing one of the quarto notebook ( I removed those changes entirely, and just committed the ones that fixes the double/triple exception rendering. |
I have something that can also improve the exception look on that docs page, will do in a follow-up. |
Just to wrap this up, here's the current state of the art for the various interpreters/notebooks: Codefrom ibis.interactive import *
t = ibis.memtable({"x": [1, 2, 3]})
t2 = ex.penguins.fetch()
t2.island + t.x.cast(str) # expected exception Vanilla Python REPL>>> from ibis.interactive import *
>>>
>>> t = ibis.memtable({"x": [1, 2, 3]})
>>> t2 = ex.penguins.fetch()
>>>
>>> t2.island + t.x.cast(str) # expected exception
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/cloud/src/github.com/ibis/ibis/expr/types/core.py", line 83, in __repr__
return _capture_rich_renderable(self)
File "/home/cloud/src/github.com/ibis/ibis/expr/types/core.py", line 63, in _capture_rich_renderable
console.print(renderable)
File "/nix/store/kzjp79qwj05yn1jh08d7j74szsfkq08m-python3-3.10.14-env/lib/python3.10/site-packages/rich/console.py", line 1710, in print
extend(render(renderable, render_options))
File "/nix/store/kzjp79qwj05yn1jh08d7j74szsfkq08m-python3-3.10.14-env/lib/python3.10/site-packages/rich/console.py", line 1311, in render
render_iterable = renderable.__rich_console__(self, _options) # type: ignore[union-attr]
File "/home/cloud/src/github.com/ibis/ibis/expr/types/core.py", line 106, in __rich_console__
rich_object = to_rich(self, console_width=console_width)
File "/home/cloud/src/github.com/ibis/ibis/expr/types/pretty.py", line 274, in to_rich
return _to_rich_table(
File "/home/cloud/src/github.com/ibis/ibis/expr/types/pretty.py", line 318, in _to_rich_table
table = tablish.as_table()
File "/home/cloud/src/github.com/ibis/ibis/expr/types/generic.py", line 1538, in as_table
raise com.RelationError(
ibis.common.exceptions.RelationError: Cannot convert <class 'ibis.expr.types.strings.StringColumn'> expression involving multiple base table references to a projection IPython REPLJupyter notebookQuarto pagevscode |
Based on #9811, I removed the code (
_repr_mimebundle_
) that was causing duplicated tracebacks. Instead I implemented_repr_pretty_
(for the consoles) and_repr_html_
for the notebook.Closes #9990.