mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-30 13:10:53 +08:00
ENH: PY2 compat with blaze loader
This commit is contained in:
1 parent
9c37011a38
commit
a18b1d7adb
1 file changed
+7
-1
@@ -144,7 +144,7 @@ from numpy.lib.stride_tricks import as_strided
|
||||
from odo import odo
|
||||
import pandas as pd
|
||||
from toolz import flip, memoize, compose, complement, identity
|
||||
from six import with_metaclass
|
||||
from six import with_metaclass, PY2
|
||||
|
||||
|
||||
from ..data.dataset import DataSet, Column
|
||||
@@ -298,6 +298,12 @@ def new_dataset(expr, deltas):
|
||||
name = expr._name
|
||||
if expr._name is None:
|
||||
name = next(_new_names)
|
||||
|
||||
# unicode is a name error in py3 but the branch is only hit
|
||||
# when we are in python 2.
|
||||
if PY2 and isinstance(name, unicode): # noqa
|
||||
name = name.encode('utf-8')
|
||||
|
||||
return type(name, (DataSet,), columns)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user