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

[BUG] repr fails for pd.Series in Jupyter with pretty.install() #1717

Closed
xoolive opened this issue Nov 24, 2021 · 3 comments · Fixed by #1804
Closed

[BUG] repr fails for pd.Series in Jupyter with pretty.install() #1717

xoolive opened this issue Nov 24, 2021 · 3 comments · Fixed by #1804
Assignees
Labels
bug Something isn't working

Comments

@xoolive
Copy link

xoolive commented Nov 24, 2021

Describe the bug

image

Any pd.Series does not appear in Jupyter (both Lab and Notebook) after pretty.install(), but appears with pretty.pprint().
This is not the case with other pandas structures.

To Reproduce

For copy paste purposes:

from rich import pretty
pretty.install()

import pandas as pd
df = pd.DataFrame.from_records([{'a': 1, 'b': 1}, {'a': 2, 'b': 2}])
df.a  # no output

pretty.pprint(df.a)  # outputs fine
python -m rich.diagnose
python -m rich._windows
pip freeze | grep rich
╭─────────────────────── <class 'rich.console.Console'> ───────────────────────╮
│ A high level console interface.                                              │
│                                                                              │
│ ╭──────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=80 ColorSystem.TRUECOLOR>                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│     color_system = 'truecolor'                                               │
│         encoding = 'utf-8'                                                   │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w'               │
│                    encoding='utf-8'>                                         │
│           height = 24                                                        │
│    is_alt_screen = False                                                     │
│ is_dumb_terminal = False                                                     │
│   is_interactive = True                                                      │
│       is_jupyter = False                                                     │
│      is_terminal = True                                                      │
│   legacy_windows = False                                                     │
│         no_color = False                                                     │
│          options = ConsoleOptions(                                           │
│                        size=ConsoleDimensions(width=80, height=24),          │
│                        legacy_windows=False,                                 │
│                        min_width=1,                                          │
│                        max_width=80,                                         │
│                        is_terminal=True,                                     │
│                        encoding='utf-8',                                     │
│                        max_height=24,                                        │
│                        justify=None,                                         │
│                        overflow=None,                                        │
│                        no_wrap=False,                                        │
│                        highlight=None,                                       │
│                        markup=None,                                          │
│                        height=None                                           │
│                    )                                                         │
│            quiet = False                                                     │
│           record = False                                                     │
│         safe_box = True                                                      │
│             size = ConsoleDimensions(width=80, height=24)                    │
│        soft_wrap = False                                                     │
│           stderr = False                                                     │
│            style = None                                                      │
│         tab_size = 8                                                         │
│            width = 80                                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
platform="Linux"
WindowsConsoleFeatures(vt=False, truecolor=False)
rich==10.14.0
@xoolive
Copy link
Author

xoolive commented Nov 24, 2021

Probably irrelevant but inspect looks beautiful too, only automatic repr doesn't work.
image

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

Did I solve your problem?

Why not buy the devs a coffee to say thanks?

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

Did I solve your problem?

Why not buy the devs a coffee to say thanks?

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 11, 2022
11.0.0

Added

Added max_depth arg to pretty printing Textualize/rich#1585
Added vertical_align to Table.add_row Textualize/rich#1590

Fixed

Fixed issue with pretty repr in jupyter notebook Textualize/rich#1717
Fix Traceback theme defaults override user supplied styles Textualize/rich#1786

Changed

breaking Deprecated rich.console.RenderGroup, now named rich.console.Group
breaking Syntax.__init__ parameter lexer_name renamed to lexer
Syntax constructor accepts both str and now a pygments lexer Textualize/rich#1748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants