Skip to content

Commit

Permalink
Use parallel_types() in from_pandas
Browse files Browse the repository at this point in the history
This is now down rather than checking the Pandas types explicitly.
This helps with inheritance from downstream libraries.
  • Loading branch information
mrocklin committed Dec 27, 2018
1 parent 7f88c54 commit f65a17e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dask/dataframe/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ... import array as da
from ...delayed import delayed

from ..core import DataFrame, Series, Index, new_dd_object
from ..core import DataFrame, Series, Index, new_dd_object, parallel_types
from ..shuffle import set_partition
from ..utils import insert_meta_param_description, check_meta, make_meta

Expand Down Expand Up @@ -165,7 +165,7 @@ def from_pandas(data, npartitions=None, chunksize=None, sort=True, name=None):
if isinstance(getattr(data, 'index', None), pd.MultiIndex):
raise NotImplementedError("Dask does not support MultiIndex Dataframes.")

if not isinstance(data, (pd.Series, pd.DataFrame)):
if not isinstance(data, parallel_types()):
raise TypeError("Input must be a pandas DataFrame or Series")

if ((npartitions is None) == (chunksize is None)):
Expand Down

0 comments on commit f65a17e

Please sign in to comment.