Skip to content

Commit 9849a10

Browse files
committed
linting progress
1 parent 6d3a86a commit 9849a10

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

src/nested_pandas/nestedframe/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,8 +1082,9 @@ def to_parquet(self, path, **kwargs) -> None:
10821082
path : str
10831083
The path to the parquet file
10841084
kwargs : keyword arguments, optional
1085-
Keyword arguments to pass to the function
1086-
`pyarrow.parquet.write_table <https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_table.html>`_
1085+
Keyword arguments to pass to
1086+
`pyarrow.parquet.write_table
1087+
<https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_table.html>`_
10871088
10881089
Returns
10891090
-------

src/nested_pandas/nestedframe/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def read_parquet(
6666
6767
Partial loading:
6868
69-
>>> #Load only the "a" sub-column of the "nested" column
70-
>>> nf = npd.read_parquet("path/to/file.parquet", columns=["nested.a"])
69+
>>> #Load only the "flux" sub-column of the "nested" column
70+
>>> nf = npd.read_parquet("path/to/file.parquet", columns=["a", "nested.flux"])
7171
"""
7272

7373
# Type convergence for reject_nesting

tests/nested_pandas/nestedframe/test_io.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
import tempfile
33

44
import pandas as pd
5+
import pyarrow as pa
56
import pytest
6-
from nested_pandas import NestedFrame, read_parquet
7+
from nested_pandas import read_parquet
78
from pandas.testing import assert_frame_equal
89

9-
import pyarrow as pa
10-
1110

1211
def test_read_parquet():
1312
"""Test reading a parquet file with no columns specified"""
@@ -25,12 +24,16 @@ def test_read_parquet():
2524
assert nf.lincc.nest.fields == ["band", "frameworks"]
2625

2726

28-
@pytest.mark.parametrize("columns", [["a", "flux"],
29-
["flux", "nested", "lincc"],
30-
["nested.flux", "nested.band"],
31-
["flux", "nested.flux"],
32-
["nested.band", "lincc.band"],
33-
])
27+
@pytest.mark.parametrize(
28+
"columns",
29+
[
30+
["a", "flux"],
31+
["flux", "nested", "lincc"],
32+
["nested.flux", "nested.band"],
33+
["flux", "nested.flux"],
34+
["nested.band", "lincc.band"],
35+
],
36+
)
3437
def test_read_parquet_column_selection(columns):
3538
"""Test reading a parquet file with column selection"""
3639
# Load in the example file
@@ -58,13 +61,12 @@ def test_read_parquet_column_selection(columns):
5861
assert nf.nested.nest.fields == ["band"]
5962
assert nf.lincc.nest.fields == ["band"]
6063

64+
6165
@pytest.mark.parametrize("reject", [["nested"], "nested"])
6266
def test_read_parquet_reject_nesting(reject):
6367
"""Test reading a parquet file with column selection"""
6468
# Load in the example file
65-
nf = read_parquet("tests/test_data/nested.parquet",
66-
columns=["a", "nested"],
67-
reject_nesting=reject)
69+
nf = read_parquet("tests/test_data/nested.parquet", columns=["a", "nested"], reject_nesting=reject)
6870

6971
# Check the columns
7072
assert nf.columns.tolist() == ["a", "nested"]
@@ -78,9 +80,7 @@ def test_read_parquet_reject_nesting(reject):
7880
def test_read_parquet_reject_nesting_partial_loading():
7981
"""Test reading a parquet file with column selection"""
8082
# Load in the example file
81-
nf = read_parquet("tests/test_data/nested.parquet",
82-
columns=["a", "nested.t"],
83-
reject_nesting=["nested"])
83+
nf = read_parquet("tests/test_data/nested.parquet", columns=["a", "nested.t"], reject_nesting=["nested"])
8484

8585
# Check the columns
8686
assert nf.columns.tolist() == ["a", "t"]

0 commit comments

Comments
 (0)