posit-dev / great-tables

Make awesome display tables using Python.
https://posit-dev.github.io/great-tables/
MIT License
1.42k stars 48 forks source link

`GT.show()`: Exception: Unknown target display: browser #381

Open jooyoungseo opened 1 week ago

jooyoungseo commented 1 week ago

Thanks for working on .show() method. I have tested with the following code:

from great_tables import GT
from great_tables.data import sp500

GT(sp500.head()).show()

I see the following result in console:

<socket.socket fd=2528, family=2, type=1, proto=0, laddr=('127.0.0.1', 64221), raddr=('127.0.0.1', 64222)>
<class 'socket.socket'>
127.0.0.1 - - [19/Jun/2024 09:18:26] "GET /index.html HTTP/1.1" 200 -
 -
  File "<stdin>", line 1, in <module>
  File "C:\Users\jseo1005\AppData\Local\miniconda3\Lib\site-packages\great_tables\_export.py", line 123, in show
    raise Exception(f"Unknown target display: {target}")
Exception: Unknown target display: browser
>>>
machow commented 1 week ago

Shoot sorry--I also ran into this when pairing with @isabelizimm, and noticed there's also a bit of server info being printed to the console. Should be a quick fix. Thanks for testing .show() out. If there's anything else useful we can add / tweak, happy to do it!