-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change inspection default printing. And added --detail option to thrift printing.
- Loading branch information
Showing
5 changed files
with
143 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "parquet_tools" | ||
version = "0.2.5" | ||
version = "0.2.6" | ||
description = "Easy install parquet-tools" | ||
authors = ["Kentaro Ueda <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import pytest | ||
from parquet_tools.commands.inspect import _execute_detail, _execute_simple | ||
import pyarrow as pa | ||
import pandas as pd | ||
from tempfile import TemporaryDirectory | ||
import numpy as np | ||
|
||
|
||
@pytest.fixture | ||
def parquet_file(): | ||
df = pd.DataFrame( | ||
{'one': [-1, np.nan, 2.5], | ||
'two': ['foo', 'bar', 'baz'], | ||
'three': [True, False, True]} | ||
) | ||
table = pa.Table.from_pandas(df) | ||
with TemporaryDirectory() as tmp_path: | ||
pq_path = f'{tmp_path}/test.pq' | ||
pa.parquet.write_table(table, pq_path) | ||
yield pq_path | ||
|
||
|
||
def test_excute_detail(parquet_file): | ||
_execute_detail( | ||
parquet_file | ||
) | ||
# not raise error | ||
|
||
|
||
def test_excute_simple(capfd, parquet_file): | ||
_execute_simple( | ||
parquet_file | ||
) | ||
out, err = capfd.readouterr() | ||
|
||
assert err == '' | ||
assert out == ''' | ||
############ file meta data ############ | ||
created_by: parquet-cpp version 1.5.1-SNAPSHOT | ||
num_columns: 3 | ||
num_rows: 3 | ||
num_row_groups: 1 | ||
format_version: 1.0 | ||
serialized_size: 2226 | ||
############ Columns ############ | ||
one | ||
two | ||
three | ||
############ Column(one) ############ | ||
name: one | ||
path: one | ||
max_definition_level: 1 | ||
max_repetition_level: 0 | ||
physical_type: DOUBLE | ||
logical_type: None | ||
converted_type (legacy): NONE | ||
############ Column(two) ############ | ||
name: two | ||
path: two | ||
max_definition_level: 1 | ||
max_repetition_level: 0 | ||
physical_type: BYTE_ARRAY | ||
logical_type: String | ||
converted_type (legacy): UTF8 | ||
############ Column(three) ############ | ||
name: three | ||
path: three | ||
max_definition_level: 1 | ||
max_repetition_level: 0 | ||
physical_type: BOOLEAN | ||
logical_type: None | ||
converted_type (legacy): NONE | ||
''' |