|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | from collections.abc import Sequence |
4 | | -from typing import TYPE_CHECKING, Any, Literal, Protocol, TypedDict, overload |
| 4 | +from typing import TYPE_CHECKING, Any, Literal, Protocol, TypedDict, Union, overload |
5 | 5 |
|
6 | 6 | import duckdb |
| 7 | +from duckdb import Expression |
7 | 8 |
|
8 | 9 | from narwhals._typing_compat import TypeVar |
9 | 10 |
|
|
12 | 13 |
|
13 | 14 | import numpy as np |
14 | 15 | import pandas as pd |
15 | | - from duckdb import DuckDBPyConnection, Expression |
| 16 | + from duckdb import DuckDBPyConnection |
16 | 17 | from typing_extensions import TypeAlias, TypeIs |
17 | 18 |
|
18 | 19 | from narwhals.typing import Into1DArray, PythonLiteral |
19 | 20 |
|
20 | 21 |
|
21 | | -__all__ = ["BaseType", "WindowExpressionKwargs", "has_children", "is_dtype"] |
| 22 | +__all__ = [ |
| 23 | + "BaseType", |
| 24 | + "IntoColumnExpr", |
| 25 | + "WindowExpressionKwargs", |
| 26 | + "has_children", |
| 27 | + "is_dtype", |
| 28 | +] |
22 | 29 |
|
23 | 30 | IntoDuckDBLiteral: TypeAlias = """ |
24 | 31 | PythonLiteral |
@@ -60,6 +67,8 @@ class WindowExpressionKwargs(TypedDict, total=False): |
60 | 67 | _Enum: TypeAlias = Literal["enum"] |
61 | 68 | _Decimal: TypeAlias = Literal["decimal"] |
62 | 69 | _TimestampTZ: TypeAlias = Literal["timestamp with time zone"] |
| 70 | +IntoColumnExpr: TypeAlias = Union[str, Expression] |
| 71 | +"""A column name, or the result of calling `duckdb.ColumnExpression`.""" |
63 | 72 |
|
64 | 73 |
|
65 | 74 | class BaseType(Protocol[_ID_co]): |
|
0 commit comments