mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 15:00:19 +00:00
callable check fix
This commit is contained in:
+3
-3
@@ -13,7 +13,6 @@ from copy import copy
|
||||
from operator import itemgetter
|
||||
|
||||
from tablib import formats
|
||||
import collections
|
||||
|
||||
|
||||
from tablib.compat import OrderedDict
|
||||
@@ -276,7 +275,8 @@ class Dataset(object):
|
||||
else:
|
||||
header = []
|
||||
|
||||
if len(col) == 1 and isinstance(col[0], collections.Callable):
|
||||
if len(col) == 1 and hasattr(col[0], '__call__'):
|
||||
|
||||
col = list(map(col[0], self._data))
|
||||
col = tuple(header + col)
|
||||
|
||||
@@ -547,7 +547,7 @@ class Dataset(object):
|
||||
col = list(col)
|
||||
|
||||
# Callable Columns...
|
||||
if len(col) == 1 and isinstance(col[0], collections.Callable):
|
||||
if len(col) == 1 and hasattr(col[0], '__call__'):
|
||||
col = list(map(col[0], self._data))
|
||||
|
||||
col = self._clean_col(col)
|
||||
|
||||
Reference in New Issue
Block a user