Repository: vaexio/vaex

Issue:
plot_widget fails with "AttributeError: module 'vaex.dataset' has no attribute '_ensure_list'"
On a fresh vaex conda install, the following fails

```python
import vaex as vx
import numpy as np

df = vx.from_arrays(
    x=np.random.normal(0,0.1,10**6), 
    y=np.random.lognormal(0,0.1,10**6)
)

df.plot_widget(df.x, df.y)  # <-- This fails
```
with this stack trace:

```
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-33-a19d3c9083fd> in <module>
----> 1 df.plot_widget(df.x, df.y)

~/miniconda3/envs/vaex/lib/python3.6/site-packages/vaex/dataframe.py in plot_widget(self, x, y, z, grid, shape, limits, what, figsize, f, figure_key, fig, axes, xlabel, ylabel, title, show, selection, colormap, grid_limits, normalize, grid_before, what_kwargs, type, scales, tool_select, bq_cleanup, backend, **kwargs)
   1440                      f=f, figure_key=figure_key, fig=fig,
   1441                      selection=selection, grid_before=grid_before,
-> 1442                      grid_limits=grid_limits, normalize=normalize, colormap=colormap, what_kwargs=what_kwargs, **kwargs)
   1443         if show:
   1444             plot2d.show()

~/miniconda3/envs/vaex/lib/python3.6/site-packages/vaex/jupyter/plot.py in __init__(self, **kwargs)
    457 
    458     def __init__(self, **kwargs):
--> 459         super(Plot2dDefault, self).__init__(**kwargs)
    460 
    461     def colorize(self, grid):

~/miniconda3/envs/vaex/lib/python3.6/site-packages/vaex/jupyter/plot.py in __init__(self, backend, dataset, x, y, z, w, grid, limits, shape, what, f, vshape, selection, grid_limits, normalize, colormap, figure_key, fig, what_kwargs, grid_before, vcount_limits, controls_selection, **kwargs)
    146             self.widget_grid_limits = None
    147 
--> 148         selections = vaex.dataset._ensure_list(self.selection)
    149         selections = [_translate_selection(k) for k in selections]
    150         selections = [k for k in selections if k]

AttributeError: module 'vaex.dataset' has no attribute '_ensure_list'
```
This is in a clean conda (4.5.12) environment with only `jupyterlab` and `vaex`(and their dependencies) installed from conda-forge:

```shell
$ conda create -n vaex
$ conda activate vaex
$ conda install -c conda-forge jupyterlab vaex
```
For completeness, here's the output of `conda list`:
```
# packages in environment at /Users/teakewerk/miniconda3/envs/vaex:
#
# Name                    Version                   Build  Channel
aplus                     0.11.0                     py_1    conda-forge
appnope                   0.1.0                 py36_1000    conda-forge
asn1crypto                0.24.0                py36_1003    conda-forge
astropy                   3.1.1            py36h470a237_0    conda-forge
atomicwrites              1.2.1                      py_0    conda-forge
attrs                     18.2.0                     py_0    conda-forge
backcall                  0.1.0                      py_0    conda-forge
blas                      1.0                         mkl    defaults
bleach                    3.1.0                      py_0    conda-forge
bqplot                    0.11.3                py36_1000    conda-forge
branca                    0.3.1                      py_0    conda-forge
ca-certificates           2018.11.29           ha4d7672_0    conda-forge
cachetools                3.0.0                      py_0    conda-forge
certifi                   2018.11.29            py36_1000    conda-forge
cffi                      1.11.5           py36h5e8e0c9_1    conda-forge
chardet                   3.0.4                 py36_1003    conda-forge
cloudpickle               0.6.1                      py_0    conda-forge
cryptography              2.3.1            py36hdffb7b8_0    conda-forge
cryptography-vectors      2.3.1                 py36_1000    conda-forge
cycler                    0.10.0                     py_1    conda-forge
cytoolz                   0.9.0.1          py36h470a237_1    conda-forge
dask-core                 1.0.0                      py_0    conda-forge
decorator                 4.3.0                      py_0    conda-forge
entrypoints               0.3                   py36_1000    conda-forge
freetype                  2.9.1                h6debe1e_4    conda-forge
future                    0.17.1                py36_1000    conda-forge
h5py                      2.9.0            py36he5c79e1_0    conda-forge
hdf5                      1.10.4          nompi_h5598ddc_1105    conda-forge
icu                       58.2                 hfc679d8_0    conda-forge
idna                      2.8                   py36_1000    conda-forge
imageio                   2.4.1                 py36_1000    conda-forge
intel-openmp              2019.1                      144    defaults
ipydatawidgets            4.0.0                      py_0    conda-forge
ipykernel                 5.1.0           py36h24bf2e0_1001    conda-forge
ipyleaflet                0.9.2                 py36_1001    conda-forge
ipympl                    0.2.1                 py36_1000    conda-forge
ipyscales                 0.3.0                      py_0    conda-forge
ipython                   7.2.0           py36h24bf2e0_1000    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipyvolume                 0.5.1                 py36_1001    conda-forge
ipywebrtc                 0.4.3                 py36_1000    conda-forge
ipywidgets                7.4.2                      py_0    conda-forge
jedi                      0.13.2                py36_1000    conda-forge
jinja2                    2.10                       py_1    conda-forge
jpeg                      9c                   h470a237_1    conda-forge
jsonschema                3.0.0a3               py36_1000    conda-forge
jupyter_client            5.2.4                      py_0    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
jupyterlab                0.35.4                   py36_0    conda-forge
jupyterlab_server         0.2.0                      py_0    conda-forge
kapteyn                   2.3              py36h18b3941_2    conda-forge
kiwisolver                1.0.1            py36h2d50403_2    conda-forge
libcxx                    7.0.0                h2d50403_2    conda-forge
libffi                    3.2.1                hfc679d8_5    conda-forge
libgfortran               3.0.1                h93005f0_2    defaults
libpng                    1.6.36               ha92aebf_0    conda-forge
libsodium                 1.0.16               h470a237_1    conda-forge
libtiff                   4.0.10               he6b73bb_1    conda-forge
llvm-meta                 7.0.0                         0    conda-forge
markupsafe                1.1.0            py36h470a237_0    conda-forge
matplotlib                3.0.2                    py36_1    conda-forge
matplotlib-base           3.0.2            py36hb2d221d_1    conda-forge
mistune                   0.8.4            py36h470a237_0    conda-forge
mkl                       2019.1                      144    defaults
mkl_fft                   1.0.10                   py36_0    conda-forge
mkl_random                1.0.2                    py36_0    conda-forge
more-itertools            4.3.0                 py36_1000    conda-forge
nbconvert                 5.3.1                      py_1    conda-forge
nbformat                  4.4.0                      py_1    conda-forge
ncurses                   6.1                  hfc679d8_2    conda-forge
networkx                  2.2                        py_1    conda-forge
notebook                  5.7.4                 py36_1000    conda-forge
numpy                     1.15.4           py36hacdab7b_0    defaults
numpy-base                1.15.4           py36h6575580_0    defaults
olefile                   0.46                       py_0    conda-forge
openssl                   1.0.2p               h470a237_2    conda-forge
pandas                    0.23.4           py36hf8a1672_0    conda-forge
pandoc                    2.5                           0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.3.1                      py_0    conda-forge
pexpect                   4.6.0                 py36_1000    conda-forge
pickleshare               0.7.5                 py36_1000    conda-forge
pillow                    5.4.1            py36hc736899_0    conda-forge
pip                       18.1                  py36_1000    conda-forge
pluggy                    0.8.1                      py_0    conda-forge
progressbar2              3.38.0                     py_1    conda-forge
prometheus_client         0.5.0                      py_0    conda-forge
prompt_toolkit            2.0.7                      py_0    conda-forge
psutil                    5.4.8            py36h470a237_0    conda-forge
ptyprocess                0.6.0                 py36_1000    conda-forge
py                        1.7.0                      py_0    conda-forge
pycparser                 2.19                       py_0    conda-forge
pygments                  2.3.1                      py_0    conda-forge
pyopengl                  3.1.1a1                    py_1    conda-forge
pyopenssl                 18.0.0                py36_1000    conda-forge
pyparsing                 2.3.0                      py_0    conda-forge
pyqt                      5.6.0            py36h8210e8a_8    conda-forge
pyrsistent                0.14.9           py36h470a237_0    conda-forge
pysocks                   1.6.8                 py36_1002    conda-forge
pytest                    4.1.0                 py36_1000    conda-forge
pytest-arraydiff          0.3                        py_0    conda-forge
pytest-astropy            0.4.0                      py_0    conda-forge
pytest-doctestplus        0.1.3                      py_0    conda-forge
pytest-openfiles          0.3.1                      py_0    conda-forge
pytest-remotedata         0.3.1                      py_0    conda-forge
pytest-runner             4.2                        py_1    conda-forge
python                    3.6.7                h5001a0f_1    conda-forge
python-dateutil           2.7.5                      py_0    conda-forge
python-utils              2.3.0                      py_1    conda-forge
pythreejs                 2.0.2                 py36_1000    conda-forge
pytz                      2018.9                     py_0    conda-forge
pywavelets                1.0.1            py36h7eb728f_0    conda-forge
pyyaml                    3.13             py36h470a237_1    conda-forge
pyzmq                     17.1.2           py36hae99301_1    conda-forge
qt                        5.6.2               h4e759b2_11    conda-forge
readline                  7.0                  haf1bffa_1    conda-forge
requests                  2.21.0                py36_1000    conda-forge
scikit-image              0.14.1           py36hfc679d8_4    conda-forge
scipy                     1.1.0            py36h1410ff5_2    defaults
send2trash                1.5.0                      py_0    conda-forge
setuptools                40.6.3                   py36_0    conda-forge
sip                       4.18.1           py36hfc679d8_0    conda-forge
six                       1.12.0                py36_1000    conda-forge
sqlite                    3.26.0               hb1c47c0_0    conda-forge
tabulate                  0.8.2                      py_0    conda-forge
terminado                 0.8.1                 py36_1001    conda-forge
testpath                  0.4.2                 py36_1000    conda-forge
tk                        8.6.9                ha92aebf_0    conda-forge
toolz                     0.9.0                      py_1    conda-forge
tornado                   5.1.1            py36h470a237_0    conda-forge
traitlets                 4.3.2                 py36_1000    conda-forge
traittypes                0.2.1                      py_1    conda-forge
urllib3                   1.24.1                py36_1000    conda-forge
vaex                      1.0.0b7                    py_0    conda-forge
vaex-astro                0.2.0                    py36_0    conda-forge
vaex-core                 0.6.1            py36hf8a1672_0    conda-forge
vaex-distributed          0.2.0                      py_0    conda-forge
vaex-hdf5                 0.2.1                      py_0    conda-forge
vaex-jupyter              0.2.1                      py_0    conda-forge
vaex-server               0.2.1                      py_0    conda-forge
vaex-ui                   0.2.0                      py_0    conda-forge
vaex-viz                  0.3.2                      py_0    conda-forge
wcwidth                   0.1.7                      py_1    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.32.3                   py36_0    conda-forge
widgetsnbextension        3.4.2                 py36_1000    conda-forge
xarray                    0.10.9                py36_1000    conda-forge
xz                        5.2.4                h470a237_1    conda-forge
yaml                      0.1.7                h470a237_1    conda-forge
zeromq                    4.2.5                hfc679d8_6    conda-forge
zlib                      1.2.11               h470a237_4    conda-forge
```


Discussion:

Resolving patch:
diff --git a/packages/vaex-core/vaex/dataset.py b/packages/vaex-core/vaex/dataset.py
--- a/packages/vaex-core/vaex/dataset.py
+++ b/packages/vaex-core/vaex/dataset.py
@@ -1,4 +1,32 @@
 from .dataframe import *
+from .dataframe import (
+    # .dataframe imports from .utils
+    _ensure_strings_from_expressions,
+    _ensure_string_from_expression,
+    _ensure_list,
+    _is_limit,
+    _isnumber,
+    _issequence,
+    _is_string,
+    _parse_reduction,
+    _parse_n,
+    _normalize_selection_name,
+    _normalize,
+    _parse_f,
+    _expand,
+    _expand_shape,
+    _expand_limits,
+    _split_and_combine_mask,
+    # dataframe definitions
+    _ColumnConcatenatedLazy,
+    _doc_snippets,
+    _functions_statistics_1d,
+    _hidden,
+    _is_array_type_ok,
+    _is_dtype_ok,
+    _requires
+)
+
 # alias kept for backward compatibility
 Dataset = DataFrame
 DatasetLocal = DataFrameLocal


Test patch: