Skip to content

Commit

Permalink
Merge pull request blaze#1500 from kwmsmith/stringify-column-names
Browse files Browse the repository at this point in the history
Stringify column names to workaround a PY2 Pandas bug.
  • Loading branch information
kwmsmith committed May 6, 2016
2 parents e33bb61 + 6f67b09 commit 7fd427a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blaze/compute/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def pre_compute(expr, data, comfortable_memory=None, chunksize=2**18, **kwargs):
leaf = oexpr._leaves()[0]
pth = list(path(oexpr, leaf))
if len(pth) >= 2 and isinstance(pth[-2], (Projection, Field)):
kwargs['usecols'] = pth[-2].fields
# NOTE: FIXME: We pass the column names through `str` to workaround a
# PY2 Pandas bug with strings / unicode objects.
kwargs['usecols'] = list(map(str, pth[-2].fields))

if chunksize:
return into(chunks(pd.DataFrame), data, dshape=leaf.dshape, **kwargs)
Expand Down

0 comments on commit 7fd427a

Please sign in to comment.