Skip to content

Commit

Permalink
Allow for NULL converted type (#340)
Browse files Browse the repository at this point in the history
* Allow for NULL converted type

* Add test and test file
  • Loading branch information
martindurant committed Jun 5, 2018
1 parent fce1cfd commit 35a1b0b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions fastparquet/parquet.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ enum ConvertedType {
* particular timezone or date.
*/
INTERVAL = 21;
NULL = 24;

/**
* Annotates a column that is always null
Expand Down
3 changes: 3 additions & 0 deletions fastparquet/parquet_thrift/parquet/ttypes.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions fastparquet/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,3 +656,10 @@ def test_only_partition_columns(tempdir):
with pytest.raises(ValueError):
# because this leaves no data to write
write(tempdir, df[['b']], file_scheme='hive', partition_on=['b'])


def test_empty_df():
p = ParquetFile(os.path.join(TEST_DATA, "empty.parquet"))
df = p.to_pandas()
assert list(p.columns) == ['a', 'b', 'c', '__index_level_0__']
assert len(df) == 0
Binary file added test-data/empty.parquet
Binary file not shown.
Binary file removed test-data/test.parquet
Binary file not shown.

0 comments on commit 35a1b0b

Please sign in to comment.