vaexio / vaex

Out-of-Core hybrid Apache Arrow/NumPy DataFrame for Python, ML, visualization and exploration of big tabular data at a billion rows per second 🚀
https://vaex.io
MIT License
8.27k stars 590 forks source link

[BUG-REPORT] UnboundLocalError: local variable 'columns_sliced' referenced before assignment #2289

Open saluto opened 1 year ago

saluto commented 1 year ago

Description

I run the following in a Jupyter notebook:

import vaex as vx
vx.settings.display.max_columns = None
vx.from_dict({"x": [1]})

I expect that the dataframe is displayed. But I get this error:

File [...]/lib/python3.9/site-packages/vaex/dataframe.py:4082, in DataFrame._as_table(self, i1, i2, j1, j2, format, ellipsis)
   4080 # parts += ["<thead><tr>"]
   4081 for i, name in enumerate(column_names):
-> 4082     if columns_sliced == i:
   4083         values_list.append([ellipsis, []])
   4084     values_list.append([name, []])
UnboundLocalError: local variable 'columns_sliced' referenced before assignment

Is vx.settings.display.max_columns = None not supported? Then, why is it checked here? So I think it is just a bug. Setting columns_sliced = None before the loop would fix it.

Software information