Skip to content

Add categorical info to metadata - #112

Merged
martindurant merged 1 commit into
dask:masterfrom
martindurant:auto_cats
Mar 22, 2017
Merged

martindurant merged 1 commit into
dask:masterfrom
martindurant:auto_cats

Conversation

@martindurant

Copy link
Copy Markdown
Member

Now, to_pandas() et al will automatically use categoricals for
data written by fastparquet. Previous behaviour remains for files
from other parquet writers.

To not load as categorical for fastparquet-written data, use
to_pandas({}), to_pandas([])...

Fixes #111

Now, to_pandas() et al will automatically use categoricals for
data written by fastparquet. Previous behaviour remains for files
from other parquet writers.

To *not* load as categorical for fastparquet-written data, use
to_pandas({}), to_pandas([])...
@martindurant

Copy link
Copy Markdown
Member Author

@mrocklin , automatically inferring categorical columns will not yet work via dask, because of dask/dataframe/io/parquet.py:L78

    categories = categories or []

(category type is only inferred if passed as None, [] would mean "I want no categorical columns", but the dtypes now show up wrong)
Correction of the dask code should follow shortly after the merging of this code.

martindurant pushed a commit to martindurant/dask that referenced this pull request Mar 22, 2017
@martindurant
martindurant merged commit e0cac3c into dask:master Mar 22, 2017
@martindurant
martindurant deleted the auto_cats branch March 22, 2017 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant