Repository: vaexio/vaex

Issue:
[BUG-REPORT] dtype.name for large_string crash
**Description**
When using dtype.name for large_string crash, it crahs with:
```
...
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 187, in numpy_dtype
    dtype = arrow_type.to_pandas_dtype()
  File "pyarrow/types.pxi", line 200, in pyarrow.lib.DataType.to_pandas_dtype
NotImplementedError: large_string
```

**Software information**
 {'vaex': '4.0.0',
 'vaex-core': '4.0.1',
 'vaex-viz': '0.5.0',
 'vaex-hdf5': '0.7.0',
 'vaex-server': '0.4.0',
 'vaex-astro': '0.8.0',
 'vaex-jupyter': '0.6.0',
 'vaex-ml': '0.11.0'}
 - pip
 - OSX

**Additional information**
Reproduce:
```
df = vaex.from_arrays(a=['a','b','c'])
df['b'] = df['a']+'!'
df['b'].dtype.name # this line crash

>>>
Traceback (most recent call last):
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-33-d125ea624db5>", line 1, in <module>
    df['b'].dtype.name
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 78, in name
    return self.numpy.name
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 91, in numpy
    return vaex.array_types.to_numpy_type(self.internal)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 241, in to_numpy_type
    return numpy_dtype_from_arrow_type(data_type, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 251, in numpy_dtype_from_arrow_type
    return numpy_dtype(data, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 187, in numpy_dtype
    dtype = arrow_type.to_pandas_dtype()
  File "pyarrow/types.pxi", line 200, in pyarrow.lib.DataType.to_pandas_dtype
NotImplementedError: large_string

```

[BUG-REPORT] dtype.name for large_string crash
**Description**
When using dtype.name for large_string crash, it crahs with:
```
...
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 187, in numpy_dtype
    dtype = arrow_type.to_pandas_dtype()
  File "pyarrow/types.pxi", line 200, in pyarrow.lib.DataType.to_pandas_dtype
NotImplementedError: large_string
```

**Software information**
 {'vaex': '4.0.0',
 'vaex-core': '4.0.1',
 'vaex-viz': '0.5.0',
 'vaex-hdf5': '0.7.0',
 'vaex-server': '0.4.0',
 'vaex-astro': '0.8.0',
 'vaex-jupyter': '0.6.0',
 'vaex-ml': '0.11.0'}
 - pip
 - OSX

**Additional information**
Reproduce:
```
df = vaex.from_arrays(a=['a','b','c'])
df['b'] = df['a']+'!'
df['b'].dtype.name # this line crash

>>>
Traceback (most recent call last):
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-33-d125ea624db5>", line 1, in <module>
    df['b'].dtype.name
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 78, in name
    return self.numpy.name
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 91, in numpy
    return vaex.array_types.to_numpy_type(self.internal)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 241, in to_numpy_type
    return numpy_dtype_from_arrow_type(data_type, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 251, in numpy_dtype_from_arrow_type
    return numpy_dtype(data, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 187, in numpy_dtype
    dtype = arrow_type.to_pandas_dtype()
  File "pyarrow/types.pxi", line 200, in pyarrow.lib.DataType.to_pandas_dtype
NotImplementedError: large_string

```



Discussion:
another case:
```
df = vaex.from_arrays(a=['a','b'])
df['b'] = df['a']+'!'
df['b'].dtype.is_numeric
>>>
Traceback (most recent call last):
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-35-d82fd4ba372c>", line 1, in <module>
    df['b'].dtype.is_numeric
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 137, in is_numeric
    return self.kind in 'fiu'
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 82, in kind
    return self.numpy.kind
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 91, in numpy
    return vaex.array_types.to_numpy_type(self.internal)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 241, in to_numpy_type
    return numpy_dtype_from_arrow_type(data_type, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 251, in numpy_dtype_from_arrow_type
    return numpy_dtype(data, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 187, in numpy_dtype
    dtype = arrow_type.to_pandas_dtype()
  File "pyarrow/types.pxi", line 200, in pyarrow.lib.DataType.to_pandas_dtype
NotImplementedError: large_string

```
another case:
```
df = vaex.from_arrays(a=['a','b'])
df['b'] = df['a']+'!'
df['b'].dtype.is_numeric
>>>
Traceback (most recent call last):
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-35-d82fd4ba372c>", line 1, in <module>
    df['b'].dtype.is_numeric
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 137, in is_numeric
    return self.kind in 'fiu'
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 82, in kind
    return self.numpy.kind
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/datatype.py", line 91, in numpy
    return vaex.array_types.to_numpy_type(self.internal)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 241, in to_numpy_type
    return numpy_dtype_from_arrow_type(data_type, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 251, in numpy_dtype_from_arrow_type
    return numpy_dtype(data, strict=strict)
  File "/Users/yonatanalexander/.virtualenvs/beyond/lib/python3.7/site-packages/vaex/array_types.py", line 187, in numpy_dtype
    dtype = arrow_type.to_pandas_dtype()
  File "pyarrow/types.pxi", line 200, in pyarrow.lib.DataType.to_pandas_dtype
NotImplementedError: large_string

```

Resolving patch:
diff --git a/packages/vaex-core/vaex/datatype.py b/packages/vaex-core/vaex/datatype.py
--- a/packages/vaex-core/vaex/datatype.py
+++ b/packages/vaex-core/vaex/datatype.py
@@ -74,8 +74,24 @@ def __repr__(self):
 
     @property
     def name(self):
-        '''Alias of dtype.numpy.name'''
-        return self.numpy.name
+        '''Alias of dtype.numpy.name or str(dtype.arrow) if not primitive
+
+        >>> DataType(np.dtype('f8')).name
+        'float64'
+        >>> DataType(np.dtype('>f4')).name
+        'float32'
+        >>> DataType(pa.float64()).name
+        'float64'
+        >>> DataType(pa.large_string()).name
+        'large_string'
+        >>> DataType(pa.string()).name
+        'string'
+        >>> DataType(pa.bool_()).name
+        'bool'
+        >>> DataType(np.dtype('?')).name
+        'bool'
+        '''
+        return self.numpy.name if (self.is_primitive or self.is_datetime) else str(self.internal)
 
     @property
     def kind(self):
@@ -133,8 +149,13 @@ def is_numeric(self):
         True
         >>> DataType(pa.float32()).is_numeric
         True
+        >>> DataType(pa.large_string()).is_numeric
+        False
         '''
-        return self.kind in 'fiu'
+        try:
+            return self.kind in 'fiu'
+        except NotImplementedError:
+            return False
 
     @property
     def is_primitive(self):


Test patch: