Skip to content

Commit 31a5259

Browse files
committed
Merge remote-tracking branch 'upstream/main' into from-numpy-2d-ns
2 parents f07cf38 + daaeaf9 commit 31a5259

File tree

17 files changed

+27
-91
lines changed

17 files changed

+27
-91
lines changed

.github/workflows/extremes.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
cache-suffix: ${{ matrix.python-version }}
6363
cache-dependency-glob: "pyproject.toml"
6464
- name: install-pretty-old-versions
65-
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.3 numpy==1.17.5 pyarrow==11.0.0 "pyarrow-stubs<17" pyspark==3.5.0 scipy==1.5.0 scikit-learn==1.1.0 duckdb==1.0 tzdata backports.zoneinfo --system
65+
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.3 numpy==1.17.5 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.5.0 scikit-learn==1.1.0 duckdb==1.0 tzdata backports.zoneinfo --system
6666
- name: install-reqs
6767
run: uv pip install -e . --group tests --system
6868
- name: show-deps
@@ -76,7 +76,6 @@ jobs:
7676
echo "$DEPS" | grep 'polars==0.20.3'
7777
echo "$DEPS" | grep 'numpy==1.17.5'
7878
echo "$DEPS" | grep 'pyarrow==11.0.0'
79-
echo "$DEPS" | grep 'pyspark==3.5.0'
8079
echo "$DEPS" | grep 'scipy==1.5.0'
8180
echo "$DEPS" | grep 'scikit-learn==1.1.0'
8281
echo "$DEPS" | grep 'duckdb==1.0'
@@ -101,7 +100,7 @@ jobs:
101100
cache-suffix: ${{ matrix.python-version }}
102101
cache-dependency-glob: "pyproject.toml"
103102
- name: install-not-so-old-versions
104-
run: uv pip install tox virtualenv setuptools pandas==2.0.3 polars==0.20.8 numpy==1.24.4 pyarrow==15.0.0 "pyarrow-stubs<17" pyspark==3.5.0 scipy==1.8.0 scikit-learn==1.3.0 duckdb==1.0 dask[dataframe]==2024.10 tzdata --system
103+
run: uv pip install tox virtualenv setuptools pandas==2.0.3 polars==0.20.8 numpy==1.24.4 pyarrow==15.0.0 "pyarrow-stubs<17" scipy==1.8.0 scikit-learn==1.3.0 duckdb==1.0 dask[dataframe]==2024.10 tzdata --system
105104
- name: install-reqs
106105
run: uv pip install -e . --group tests --system
107106
- name: show-deps
@@ -113,7 +112,6 @@ jobs:
113112
echo "$DEPS" | grep 'polars==0.20.8'
114113
echo "$DEPS" | grep 'numpy==1.24.4'
115114
echo "$DEPS" | grep 'pyarrow==15.0.0'
116-
echo "$DEPS" | grep 'pyspark==3.5.0'
117115
echo "$DEPS" | grep 'scipy==1.8.0'
118116
echo "$DEPS" | grep 'scikit-learn==1.3.0'
119117
echo "$DEPS" | grep 'dask==2024.10'

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: install duckdb nightly
8888
run: uv pip install -U --pre duckdb --system
8989
- name: install pyspark
90-
run: uv pip install -e ".[pyspark]" --system
90+
run: echo "setuptools<78" | uv pip install -b - -e ".[pyspark]" --system
9191
# PySpark is not yet available on Python3.12+
9292
if: matrix.python-version != '3.13'
9393
- name: install ibis

.github/workflows/typing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# TODO: add more dependencies/backends incrementally
3333
run: |
3434
source .venv/bin/activate
35-
uv pip install -e ".[pyspark]" --group core --group typing
35+
echo "setuptools<78" | uv pip install -b - -e ".[pyspark]" --group core --group typing
3636
- name: show-deps
3737
run: |
3838
source .venv/bin/activate

narwhals/_arrow/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def len(self: Self) -> ArrowExpr:
7272
version=self._version,
7373
)
7474

75-
def lit(self: Self, value: Any, dtype: DType | None) -> ArrowExpr:
75+
def lit(self: Self, value: Any, dtype: DType | type[DType] | None) -> ArrowExpr:
7676
def _lit_arrow_series(_: ArrowDataFrame) -> ArrowSeries:
7777
arrow_series = ArrowSeries.from_iterable(
7878
data=[value], name="literal", context=self

narwhals/_compliant/expr.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ def from_column_indices(
106106
cls: type[Self], *column_indices: int, context: _FullContext
107107
) -> Self: ...
108108

109-
def _with_metadata(self, metadata: ExprMetadata) -> Self: ...
110-
111109
def is_null(self) -> Self: ...
112110
def abs(self) -> Self: ...
113111
def all(self) -> Self: ...
@@ -353,21 +351,6 @@ def __narwhals_namespace__(
353351
) -> EagerNamespace[EagerDataFrameT, EagerSeriesT, Self]: ...
354352
def __narwhals_expr__(self) -> None: ...
355353

356-
def _with_metadata(self, metadata: ExprMetadata) -> Self:
357-
expr = self.__class__(
358-
self._call,
359-
function_name=self._function_name,
360-
evaluate_output_names=self._evaluate_output_names,
361-
alias_output_names=self._alias_output_names,
362-
backend_version=self._backend_version,
363-
version=self._version,
364-
depth=self._depth,
365-
implementation=self._implementation,
366-
call_kwargs=self._call_kwargs,
367-
)
368-
expr._metadata = metadata
369-
return expr
370-
371354
@classmethod
372355
def _from_callable(
373356
cls,

narwhals/_compliant/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def nth(self, *column_indices: int) -> CompliantExprT:
6262
return self._expr.from_column_indices(*column_indices, context=self)
6363

6464
def len(self) -> CompliantExprT: ...
65-
def lit(self, value: Any, dtype: DType | None) -> CompliantExprT: ...
65+
def lit(self, value: Any, dtype: DType | type[DType] | None) -> CompliantExprT: ...
6666
def all_horizontal(self, *exprs: CompliantExprT) -> CompliantExprT: ...
6767
def any_horizontal(self, *exprs: CompliantExprT) -> CompliantExprT: ...
6868
def sum_horizontal(self, *exprs: CompliantExprT) -> CompliantExprT: ...

narwhals/_dask/expr.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,6 @@ def __narwhals_namespace__(self) -> DaskNamespace: # pragma: no cover
8383

8484
return DaskNamespace(backend_version=self._backend_version, version=self._version)
8585

86-
def _with_metadata(self, metadata: ExprMetadata) -> Self:
87-
expr = self.__class__(
88-
self._call,
89-
function_name=self._function_name,
90-
evaluate_output_names=self._evaluate_output_names,
91-
alias_output_names=self._alias_output_names,
92-
backend_version=self._backend_version,
93-
version=self._version,
94-
depth=self._depth,
95-
call_kwargs=self._call_kwargs,
96-
)
97-
expr._metadata = metadata
98-
return expr
99-
10086
def broadcast(self, kind: Literal[ExprKind.AGGREGATION, ExprKind.LITERAL]) -> Self:
10187
def func(df: DaskLazyFrame) -> list[dx.Series]:
10288
return [result[0] for result in self(df)]

narwhals/_dask/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
self._backend_version = backend_version
5656
self._version = version
5757

58-
def lit(self: Self, value: Any, dtype: DType | None) -> DaskExpr:
58+
def lit(self: Self, value: Any, dtype: DType | type[DType] | None) -> DaskExpr:
5959
def func(df: DaskLazyFrame) -> list[dx.Series]:
6060
if dtype is not None:
6161
native_dtype = narwhals_to_native_dtype(dtype, self._version)

narwhals/_duckdb/expr.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@ def __narwhals_namespace__(self) -> DuckDBNamespace: # pragma: no cover
7979
backend_version=self._backend_version, version=self._version
8080
)
8181

82-
def _with_metadata(self, metadata: ExprMetadata) -> Self:
83-
expr = self.__class__(
84-
self._call,
85-
evaluate_output_names=self._evaluate_output_names,
86-
alias_output_names=self._alias_output_names,
87-
backend_version=self._backend_version,
88-
version=self._version,
89-
)
90-
if func := self._window_function:
91-
expr = expr._with_window_function(func)
92-
expr._metadata = metadata
93-
return expr
94-
9582
def broadcast(self, kind: Literal[ExprKind.AGGREGATION, ExprKind.LITERAL]) -> Self:
9683
if kind is ExprKind.LITERAL:
9784
return self

narwhals/_duckdb/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def func(df: DuckDBLazyFrame) -> list[duckdb.Expression]:
213213
def when(self: Self, predicate: DuckDBExpr) -> DuckDBWhen:
214214
return DuckDBWhen.from_expr(predicate, context=self)
215215

216-
def lit(self: Self, value: Any, dtype: DType | None) -> DuckDBExpr:
216+
def lit(self: Self, value: Any, dtype: DType | type[DType] | None) -> DuckDBExpr:
217217
def func(_df: DuckDBLazyFrame) -> list[duckdb.Expression]:
218218
if dtype is not None:
219219
return [

0 commit comments

Comments
 (0)