Skip to content

Commit

Permalink
Merge pull request #303 from xhochy/cast-categoricals-in-empty_df
Browse files Browse the repository at this point in the history
Cast categoricals in empty_df in read_table
  • Loading branch information
fjetter authored Jun 19, 2020
2 parents d5851a0 + 4816b8e commit 7bb50dd
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -2,6 +2,15 @@
Changelog
=========

Version 3.9.1 (2020-06-XX)
==========================

Bug fixes
^^^^^^^^^

* Ensure that the empty (sentinel) DataFrame used in :func:`~kartothek.io.eager.read_table`
also has the correct behaviour when using the ``categoricals`` argument.

Version 3.9.0 (2020-06-03)
==========================

2 changes: 2 additions & 0 deletions kartothek/io/eager.py
Original file line number Diff line number Diff line change
@@ -310,6 +310,8 @@ def read_table(
schema=ds_factory.table_meta[table],
columns=columns[table] if columns is not None else None,
)
if categoricals:
empty_df = empty_df.astype({col: "category" for col in categoricals[table]})
dfs = [partition_data[table] for partition_data in partitions] + [empty_df]
# require meta 4 otherwise, can't construct types/columns
if categoricals:

0 comments on commit 7bb50dd

Please sign in to comment.