Skip to content

Commit 3afb8fc

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent dcb65a2 commit 3afb8fc

File tree

12 files changed

+69
-108
lines changed

12 files changed

+69
-108
lines changed

narwhals/_plan/boolean.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import typing as t
66

77
from narwhals._plan.common import Function
8-
from narwhals._plan.options import FunctionFlags
9-
from narwhals._plan.options import FunctionOptions
8+
from narwhals._plan.options import FunctionFlags, FunctionOptions
109

1110
if t.TYPE_CHECKING:
1211
from narwhals.typing import ClosedInterval

narwhals/_plan/common.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@
22

33
import datetime as dt
44
from decimal import Decimal
5-
from typing import TYPE_CHECKING
6-
from typing import TypeVar
5+
from typing import TYPE_CHECKING, TypeVar
76

87
from narwhals.utils import Version
98

109
if TYPE_CHECKING:
11-
from typing import Any
12-
from typing import Callable
13-
from typing import Iterator
10+
from typing import Any, Callable, Iterator
1411

15-
from typing_extensions import Never
16-
from typing_extensions import Self
17-
from typing_extensions import TypeAlias
18-
from typing_extensions import TypeIs
19-
from typing_extensions import dataclass_transform
12+
from typing_extensions import Never, Self, TypeAlias, TypeIs, dataclass_transform
2013

21-
from narwhals._plan.dummy import DummyCompliantExpr
22-
from narwhals._plan.dummy import DummyExpr
23-
from narwhals._plan.dummy import DummySeries
14+
from narwhals._plan.dummy import DummyCompliantExpr, DummyExpr, DummySeries
2415
from narwhals._plan.expr import FunctionExpr
2516
from narwhals._plan.options import FunctionOptions
2617
from narwhals.typing import NonNestedLiteral

narwhals/_plan/demo.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,26 @@
33
import builtins
44
import typing as t
55

6-
from narwhals._plan import aggregation as agg
7-
from narwhals._plan import boolean
8-
from narwhals._plan import expr_parsing as parse
9-
from narwhals._plan import functions as F # noqa: N812
10-
from narwhals._plan.common import ExprIR
11-
from narwhals._plan.common import IntoExpr
12-
from narwhals._plan.common import is_non_nested_literal
6+
from narwhals._plan import (
7+
aggregation as agg,
8+
boolean,
9+
expr_parsing as parse,
10+
functions as F, # noqa: N812
11+
)
12+
from narwhals._plan.common import ExprIR, IntoExpr, is_non_nested_literal
1313
from narwhals._plan.dummy import DummySeries
14-
from narwhals._plan.expr import All
15-
from narwhals._plan.expr import Column
16-
from narwhals._plan.expr import Columns
17-
from narwhals._plan.expr import IndexColumns
18-
from narwhals._plan.expr import Len
19-
from narwhals._plan.expr import Nth
20-
from narwhals._plan.literal import ScalarLiteral
21-
from narwhals._plan.literal import SeriesLiteral
14+
from narwhals._plan.expr import All, Column, Columns, IndexColumns, Len, Nth
15+
from narwhals._plan.literal import ScalarLiteral, SeriesLiteral
2216
from narwhals._plan.strings import ConcatHorizontal
2317
from narwhals.dtypes import DType
2418
from narwhals.exceptions import OrderDependentExprError
25-
from narwhals.utils import Version
26-
from narwhals.utils import flatten
19+
from narwhals.utils import Version, flatten
2720

2821
if t.TYPE_CHECKING:
2922
from typing_extensions import TypeIs
3023

3124
from narwhals._plan.dummy import DummyExpr
32-
from narwhals._plan.expr import SortBy
33-
from narwhals._plan.expr import WindowExpr
25+
from narwhals._plan.expr import SortBy, WindowExpr
3426
from narwhals.typing import NonNestedLiteral
3527

3628

narwhals/_plan/dummy.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,40 @@
55
import typing as t
66
from typing import TYPE_CHECKING
77

8-
from narwhals._plan import aggregation as agg
9-
from narwhals._plan import boolean
10-
from narwhals._plan import expr
11-
from narwhals._plan import expr_parsing as parse
12-
from narwhals._plan import functions as F # noqa: N812
13-
from narwhals._plan import operators as ops
14-
from narwhals._plan.options import EWMOptions
15-
from narwhals._plan.options import RankOptions
16-
from narwhals._plan.options import RollingOptionsFixedWindow
17-
from narwhals._plan.options import RollingVarParams
18-
from narwhals._plan.options import SortMultipleOptions
19-
from narwhals._plan.options import SortOptions
8+
from narwhals._plan import (
9+
aggregation as agg,
10+
boolean,
11+
expr,
12+
expr_parsing as parse,
13+
functions as F, # noqa: N812
14+
operators as ops,
15+
)
16+
from narwhals._plan.options import (
17+
EWMOptions,
18+
RankOptions,
19+
RollingOptionsFixedWindow,
20+
RollingVarParams,
21+
SortMultipleOptions,
22+
SortOptions,
23+
)
2024
from narwhals._plan.window import Over
2125
from narwhals.dtypes import DType
2226
from narwhals.exceptions import ComputeError
23-
from narwhals.utils import Version
24-
from narwhals.utils import _hasattr_static
25-
from narwhals.utils import flatten
27+
from narwhals.utils import Version, _hasattr_static, flatten
2628

2729
if TYPE_CHECKING:
2830
from typing_extensions import Self
2931

30-
from narwhals._plan.common import ExprIR
31-
from narwhals._plan.common import IntoExpr
32-
from narwhals._plan.common import IntoExprColumn
33-
from narwhals._plan.common import Seq
34-
from narwhals._plan.common import Udf
32+
from narwhals._plan.common import ExprIR, IntoExpr, IntoExprColumn, Seq, Udf
3533
from narwhals._plan.meta import ExprIRMetaNamespace
36-
from narwhals.typing import FillNullStrategy
37-
from narwhals.typing import NativeSeries
38-
from narwhals.typing import NumericLiteral
39-
from narwhals.typing import RankMethod
40-
from narwhals.typing import RollingInterpolationMethod
41-
from narwhals.typing import TemporalLiteral
34+
from narwhals.typing import (
35+
FillNullStrategy,
36+
NativeSeries,
37+
NumericLiteral,
38+
RankMethod,
39+
RollingInterpolationMethod,
40+
TemporalLiteral,
41+
)
4242

4343

4444
# NOTE: Overly simplified placeholders for mocking typing

narwhals/_plan/expr.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
if t.TYPE_CHECKING:
1818
from typing_extensions import Self
1919

20-
from narwhals._plan.common import Function
21-
from narwhals._plan.common import Seq
22-
from narwhals._plan.functions import MapBatches # noqa: F401
23-
from narwhals._plan.functions import RollingWindow
20+
from narwhals._plan.common import Function, Seq
21+
from narwhals._plan.functions import (
22+
MapBatches, # noqa: F401
23+
RollingWindow,
24+
)
2425
from narwhals._plan.literal import LiteralValue
2526
from narwhals._plan.operators import Operator
26-
from narwhals._plan.options import FunctionOptions
27-
from narwhals._plan.options import SortMultipleOptions
28-
from narwhals._plan.options import SortOptions
27+
from narwhals._plan.options import FunctionOptions, SortMultipleOptions, SortOptions
2928
from narwhals._plan.window import Window
3029
from narwhals.dtypes import DType
3130

narwhals/_plan/expr_parsing.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
from __future__ import annotations
22

33
# ruff: noqa: A002
4-
from typing import TYPE_CHECKING
5-
from typing import Iterable
6-
from typing import Sequence
7-
from typing import TypeVar
8-
9-
from narwhals._plan.common import is_expr
10-
from narwhals._plan.common import is_iterable_reject
11-
from narwhals.dependencies import get_polars
12-
from narwhals.dependencies import is_pandas_dataframe
13-
from narwhals.dependencies import is_pandas_series
4+
from typing import TYPE_CHECKING, Iterable, Sequence, TypeVar
5+
6+
from narwhals._plan.common import is_expr, is_iterable_reject
7+
from narwhals.dependencies import get_polars, is_pandas_dataframe, is_pandas_series
148
from narwhals.exceptions import InvalidIntoExprError
159

1610
if TYPE_CHECKING:
17-
from typing import Any
18-
from typing import Iterator
11+
from typing import Any, Iterator
1912

20-
from typing_extensions import TypeAlias
21-
from typing_extensions import TypeIs
13+
from typing_extensions import TypeAlias, TypeIs
2214

23-
from narwhals._plan.common import ExprIR
24-
from narwhals._plan.common import IntoExpr
25-
from narwhals._plan.common import Seq
15+
from narwhals._plan.common import ExprIR, IntoExpr, Seq
2616
from narwhals.dtypes import DType
2717

2818
T = TypeVar("T")

narwhals/_plan/functions.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@
99
from typing import TYPE_CHECKING
1010

1111
from narwhals._plan.common import Function
12-
from narwhals._plan.options import FunctionFlags
13-
from narwhals._plan.options import FunctionOptions
12+
from narwhals._plan.options import FunctionFlags, FunctionOptions
1413
from narwhals.exceptions import ComputeError
1514

1615
if TYPE_CHECKING:
1716
from typing import Any
1817

19-
from narwhals._plan.common import Seq
20-
from narwhals._plan.common import Udf
21-
from narwhals._plan.options import EWMOptions
22-
from narwhals._plan.options import RankOptions
23-
from narwhals._plan.options import RollingOptionsFixedWindow
18+
from narwhals._plan.common import Seq, Udf
19+
from narwhals._plan.options import EWMOptions, RankOptions, RollingOptionsFixedWindow
2420
from narwhals.dtypes import DType
2521
from narwhals.typing import FillNullStrategy
2622

narwhals/_plan/operators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
if TYPE_CHECKING:
66
from narwhals._plan.expr import BinaryExpr
77

8-
from narwhals._plan.common import ExprIR
9-
from narwhals._plan.common import Immutable
8+
from narwhals._plan.common import ExprIR, Immutable
109

1110

1211
class Operator(Immutable):

narwhals/_plan/strings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from __future__ import annotations
22

33
from narwhals._plan.common import Function
4-
from narwhals._plan.options import FunctionFlags
5-
from narwhals._plan.options import FunctionOptions
4+
from narwhals._plan.options import FunctionFlags, FunctionOptions
65

76

87
class StringFunction(Function):

narwhals/_plan/temporal.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING
4-
from typing import cast
3+
from typing import TYPE_CHECKING, cast
54

65
from narwhals._plan.common import Function
76
from narwhals._plan.options import FunctionOptions

0 commit comments

Comments
 (0)