Skip to content

Commit

Permalink
chore(python): bump black from 22.12.0 to 23.1.0 in /py-polars (pola-…
Browse files Browse the repository at this point in the history
…rs#6611)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stijn de Gooijer <stijn@degooijer.io>
  • Loading branch information
2 people authored and vincent committed Feb 9, 2023
1 parent dc530ce commit 74e8d70
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 15 deletions.
1 change: 0 additions & 1 deletion py-polars/polars/internals/batched.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def __init__(
eol_char: str = "\n",
new_columns: list[str] | None = None,
):

path: str | None
if isinstance(file, (str, Path)):
path = normalise_filepath(file)
Expand Down
5 changes: 2 additions & 3 deletions py-polars/polars/internals/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,6 @@ def __getitem__(

# df[:, unknown]
if isinstance(row_selection, slice):

# multiple slices
# df[:, :]
if isinstance(col_selection, slice):
Expand Down Expand Up @@ -1512,7 +1511,7 @@ def __getitem__(
f" boolean mask. Got {len(col_selection)}."
)
series_list = []
for (i, val) in enumerate(col_selection):
for i, val in enumerate(col_selection):
if val:
series_list.append(self.to_series(i))

Expand Down Expand Up @@ -1631,7 +1630,7 @@ def __setitem__(

# todo! we can parallelize this by calling from_numpy
columns = []
for (i, name) in enumerate(key):
for i, name in enumerate(key):
columns.append(pli.Series(name, value[:, i]))
self._df = self.with_columns(columns)._df

Expand Down
1 change: 1 addition & 0 deletions py-polars/polars/internals/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def _prepare_file_arg(
fsspec too.
"""

# Small helper to use a variable as context
@contextmanager
def managed_file(file: Any) -> Iterator[Any]:
Expand Down
1 change: 0 additions & 1 deletion py-polars/polars/internals/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ def __getitem__(
int | Series | range | slice | np.ndarray[Any, Any] | list[int] | list[bool]
),
) -> Any:

if isinstance(item, Series) and item.dtype in {
UInt8,
UInt16,
Expand Down
3 changes: 1 addition & 2 deletions py-polars/polars/testing/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ def is_categorical_dtype(data_type: Any) -> bool:
def assert_frame_equal_local_categoricals(
df_a: pli.DataFrame, df_b: pli.DataFrame
) -> None:

for ((a_name, a_value), (b_name, b_value)) in zip(
for (a_name, a_value), (b_name, b_value) in zip(
df_a.schema.items(), df_b.schema.items()
):
if a_name != b_name:
Expand Down
1 change: 1 addition & 0 deletions py-polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ ignore = [
# pydocstyle: http://www.pydocstyle.org/en/stable/error_codes.html
# numpy convention with a few additional lints
"D107",
"D202", # No blank lines allowed after function docstring -> clashes with Black
"D203",
"D212",
"D401",
Expand Down
2 changes: 1 addition & 1 deletion py-polars/requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
black==22.12.0
black==23.1.0
blackdoc==0.3.7
ruff==0.0.237
1 change: 0 additions & 1 deletion py-polars/tests/unit/test_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def test_set_tbl_cols() -> None:


def test_set_tbl_rows() -> None:

df = pl.DataFrame({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8], "c": [9, 10, 11, 12]})
ser = pl.Series("ser", [1, 2, 3, 4, 5])

Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def test_groupby_rolling_negative_offset_3914() -> None:
}
)

assert df.groupby_rolling(index_column="ints", period="2i", offset="-5i",).agg(
assert df.groupby_rolling(index_column="ints", period="2i", offset="-5i").agg(
[pl.col("ints").alias("matches")]
)["matches"].to_list() == [
[],
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/test_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def test_arrow_list_null_5697() -> None:
df = pl.from_arrow(pa_table)
pa_table = df.to_arrow()
# again to polars to test the schema
assert pl.from_arrow(pa_table,).schema == { # type: ignore[union-attr]
assert pl.from_arrow(pa_table).schema == { # type: ignore[union-attr]
"mycol": pl.List(pl.Null)
}

Expand Down
1 change: 1 addition & 0 deletions py-polars/tests/unit/test_lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ def test_self_join() -> None:

def test_preservation_of_subclasses() -> None:
"""Test for LazyFrame inheritance."""

# We should be able to inherit from polars.LazyFrame
class SubClassedLazyFrame(pl.LazyFrame):
pass
Expand Down
3 changes: 1 addition & 2 deletions py-polars/tests/unit/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ def test_rolling_groupby_extrema() -> None:
)

for df in [sorted_df, not_sorted_df]:

assert (
df.groupby_rolling(
index_column="row_nr",
Expand Down Expand Up @@ -317,7 +316,7 @@ def test_overlapping_groups_4628() -> None:
}
)
assert (
df.groupby_rolling(index_column="index", period="3i",).agg(
df.groupby_rolling(index_column="index", period="3i").agg(
[
pl.col("val").diff(n=1).alias("val.diff"),
(pl.col("val") - pl.col("val").shift(1)).alias("val - val.shift"),
Expand Down
1 change: 0 additions & 1 deletion py-polars/tests/unit/test_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ def test_sort_by_in_over_5499() -> None:


def test_merge_sorted() -> None:

df_a = (
pl.date_range(datetime(2022, 1, 1), datetime(2022, 12, 1), "1mo")
.to_frame("range")
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/test_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def test_struct_comparison() -> None:


def test_struct_order() -> None:
assert pl.DataFrame({"col1": [{"a": 1, "b": 2}, {"b": 4, "a": 3}],}).to_dict(
assert pl.DataFrame({"col1": [{"a": 1, "b": 2}, {"b": 4, "a": 3}]}).to_dict(
False
) == {"col1": [{"a": 1, "b": 2}, {"a": 3, "b": 4}]}

Expand Down

0 comments on commit 74e8d70

Please sign in to comment.