Skip to content

Commit

Permalink
Small formatting fixes (#4071)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jul 18, 2022
1 parent b062e40 commit 139db59
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion nodejs-polars/src/lazy/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl JsLazyFrame {
let strategy = match strategy.as_ref() {
"forward" => AsofStrategy::Forward,
"backward" => AsofStrategy::Backward,
_ => panic!("expected on of {{'forward', 'backward'}}"),
_ => panic!("expected one of {{'forward', 'backward'}}"),
};

let ldf = self.ldf.clone();
Expand Down
4 changes: 2 additions & 2 deletions py-polars/polars/internals/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def __to_expr(self, other: Any) -> Expr:

def __bool__(self) -> Expr:
raise ValueError(
"Since Expr are lazy, the truthiness of an Expr is ambiguous. \
Hint: use '&' or '|' to chain Expr together, not and/or."
"Since Expr are lazy, the truthiness of an Expr is ambiguous. "
"Hint: use '&' or '|' to chain Expr together, not and/or."
)

def __invert__(self) -> Expr:
Expand Down
2 changes: 0 additions & 2 deletions py-polars/polars/internals/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6363,8 +6363,6 @@ def _wrangle(x: Any) -> list:
.agg(column_to_agg) # type: ignore[arg-type]
.collect(no_optimization=True, string_cache=False)
)

pass
else:
raise ValueError(
f"argument: {column_to_agg} not understood, have you passed a list of expressions?"
Expand Down
3 changes: 1 addition & 2 deletions py-polars/polars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _datetime_to_pl_timestamp(dt: datetime, tu: str | None) -> int:
# python has us precision
return int(dt.replace(tzinfo=timezone.utc).timestamp() * 1e6)
else:
raise ValueError("expected on of {'ns', 'us', 'ms'}")
raise ValueError("expected one of {'ns', 'us', 'ms'}")


def _timedelta_to_pl_timedelta(td: timedelta, tu: str | None = None) -> int:
Expand Down Expand Up @@ -185,7 +185,6 @@ def _prepare_row_count_args(
row_count_name: str | None = None,
row_count_offset: int = 0,
) -> tuple[str, int] | None:

if row_count_name is not None:
return (row_count_name, row_count_offset)
else:
Expand Down
2 changes: 1 addition & 1 deletion py-polars/src/lazy/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ impl PyLazyFrame {
let strategy = match strategy {
"forward" => AsofStrategy::Forward,
"backward" => AsofStrategy::Backward,
_ => panic!("expected on of {{'forward', 'backward'}}"),
_ => panic!("expected one of {{'forward', 'backward'}}"),
};

let ldf = self.ldf.clone();
Expand Down
1 change: 0 additions & 1 deletion py-polars/tests/io/test_pyarrow_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


def test_dataset(io_test_dir: str) -> None:

# windows path does not seem to work
if os.name != "nt":
file = os.path.join(io_test_dir, "small.ipc")
Expand Down
1 change: 0 additions & 1 deletion py-polars/tests/test_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def test_set_tbl_rows(environ: None) -> None:


def test_string_cache(environ: None) -> None:

df1 = pl.DataFrame({"a": ["foo", "bar", "ham"], "b": [1, 2, 3]})
df2 = pl.DataFrame({"a": ["foo", "spam", "eggs"], "c": [3, 2, 2]})

Expand Down
3 changes: 2 additions & 1 deletion py-polars/tests/test_datelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,8 @@ def test_datetime_strptime_patterns() -> None:
df = pl.Series(
"date",
[
"09-05-2019" "2018-09-05",
"09-05-2019",
"2018-09-05",
"2018-09-05T04:05:01",
"2018-09-05T04:24:01.9",
"2018-09-05T04:24:02.11",
Expand Down

0 comments on commit 139db59

Please sign in to comment.