blaze / datashape

Language defining a data description protocol
BSD 2-Clause "Simplified" License
183 stars 65 forks source link

Datashape and object dtypes #192

Closed kwmsmith closed 8 years ago

kwmsmith commented 8 years ago

How does datashape handle Python objects, if at all?

For instance, if I discover() a NumPy object array, I get back something like this:

In [40]: ds = datashape.discover(np.zeros((10,), dtype='O'))

In [41]: ds
Out[41]: dshape("10 * object")

But I can't create a dshape("10 * object") via the constructor:

In [42]: ds == datashape.dshape('10 * object')
  File "<nofile>", line 1
    10 * object
DataShapeSyntaxError: Expected a dim or a dtype

Related to #120

llllllllll commented 8 years ago

This is because object is not in the no_constructor_types in type_symbol_table.

It looks like in #120 there was discussion about replacing object with str; however, right now this will cause a bug in the blaze server if you are hosting something with type object because we use dshape of str as the serialization roundtrip

kwmsmith commented 8 years ago

Closed by #193.