Skip to content

Commit

Permalink
Merge pull request #199 from martindurant/more_cats
Browse files Browse the repository at this point in the history
Not all mergers have cats
  • Loading branch information
martindurant committed Aug 24, 2017
2 parents 4843093 + 61851d8 commit 18213b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fastparquet/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,10 @@ def consolidate_categories(fmd):
for col in rg.columns:
if ".".join(col.meta_data.path_in_schema) == cat['name']:
ncats = [k.value for k in col.meta_data.key_value_metadata
if k.key == 'num_categories'][0]
if int(ncats) > cat['metadata']['num_categories']:
cat['metadata']['num_categories'] = int(ncats)
if k.key == 'num_categories']
if ncats and int(ncats[0]) > cat['metadata'][
'num_categories']:
cat['metadata']['num_categories'] = int(ncats[0])
key_value.value = json.dumps(meta, sort_keys=True)


Expand Down

0 comments on commit 18213b7

Please sign in to comment.