man-group / dtale

Visualizer for pandas data structures
http://alphatechadmin.pythonanywhere.com
GNU Lesser General Public License v2.1
4.62k stars 390 forks source link

dtale.show() error without data #835

Closed wonb168 closed 6 months ago

wonb168 commented 6 months ago
import dtale
dtale.show(open_browser=True)

then got an error in browser:

Traceback (most recent call last): File "/Users/mac/Library/Python/3.9/lib/python/site-packages/dtale/views.py", line 119, in _handle_exceptions return func(*args, **kwargs) File "/Users/mac/Library/Python/3.9/lib/python/site-packages/dtale/views.py", line 2875, in get_data curr_dtypes = [c["name"] for c in global_state.get_dtypes(data_id)] TypeError: 'NoneType' object is not iterable

why? thanks

FedererKK commented 6 months ago

You have not added any data to the dtale instance, and you can not do that. It is expected behavior

import dtale
import pandas as pd

df = pd.DataFrame([dict(a=1,b=2,c=3)])

# Assigning a reference to a running D-Tale process.
d = dtale.show(df)
aschonfeld commented 6 months ago

So @FedererKK it actually can be started without loading any data. If you do that it should prompt you with a popup to upload some data using the UI (as shown here)

@wonb168 I will look into this and get back to you

FedererKK commented 6 months ago

So @FedererKK it actually can be started without loading any data. If you do that it should prompt you with a popup to upload some data using the UI (as shown here)

@wonb168 I will look into this and get back to you

Very interesting and simple UX, I must have missed that :-)

aschonfeld commented 6 months ago

@wonb168 just released v3.9.0 to pypi (will be on conda-forge shortly) with this fix