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

docs: Exception stack traces on the "Datatypes and Datashapes" page #9990

Closed
1 task done
chrispy-snps opened this issue Sep 1, 2024 · 8 comments · Fixed by #10002
Closed
1 task done

docs: Exception stack traces on the "Datatypes and Datashapes" page #9990

chrispy-snps opened this issue Sep 1, 2024 · 8 comments · Fixed by #10002
Labels
docs Documentation related issues or PRs
Milestone

Comments

@chrispy-snps
Copy link

chrispy-snps commented Sep 1, 2024

Please describe the issue

On the "Datatypes and Datashapes" page, there are some exception stack traces in the example results:

https://ibis-project.org/concepts/datatypes

I did not check other documentation pages for similar exceptions; that might be worth a look, if there's a programmatic way to do it.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@chrispy-snps chrispy-snps added the docs Documentation related issues or PRs label Sep 1, 2024
@gforsyth
Copy link
Member

gforsyth commented Sep 1, 2024

Hey @chrispy-snps -- thanks for raising this!

That exception is included there by design, to show that you cannot arbitrarily combine columns from two separate relations without first joining them.

The exception is so long, that I think we might benefit from not actually executing the failing cell, but sort of "faking" it and only showing the relevant portion of the traceback to improve readability.

@chrispy-snps
Copy link
Author

Thanks @gforsyth!

Oops, I did not realize it was included by design - I was quickly scrolling through to look for something else, and the length threw me off. In our product's documentation, I do typically abstract away non-relevant parts of documented traced with ... to focus on the relevant bits of the trace. I wonder if there's a way in your doc framework to automatically post-process traces to the last N levels?

@lostmygithubaccount
Copy link
Member

automatically post-processing is probably possible, but for now we can at least just fake this one's output

@cpcloud
Copy link
Member

cpcloud commented Sep 2, 2024

It seems like we should understand why we're showing the exception three times.

We're showing:

  1. The rich styled one
  2. The IPython one
  3. The IPython one again

Not all of our docstrings that show exceptions have this problem, so we should understand what's happening before hacking around it.

@cpcloud
Copy link
Member

cpcloud commented Sep 2, 2024

For example, the Table.pivot_longer docstring shows some intentional exceptions, and the traceback is shown only once (in the IPython style).

@cpcloud
Copy link
Member

cpcloud commented Sep 2, 2024

It's probably because we're calling console.print_exception() and we almost certainly shouldn't be.

@cpcloud
Copy link
Member

cpcloud commented Sep 2, 2024

The second repr is from _repr_mimebundle_.

@chrispy-snps
Copy link
Author

Thank you everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related issues or PRs
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants