Skip to content

Commit 9acce69

Browse files
committed
Merge remote-tracking branch 'upstream/main' into oh-nodes
2 parents dbca5a5 + 63d7648 commit 9acce69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1025
-616
lines changed

.github/workflows/pytest.yml

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ jobs:
5252
cache-suffix: pytest-windows-${{ matrix.python-version }}
5353
cache-dependency-glob: "pyproject.toml"
5454
- name: install-reqs
55-
# we are not testing pyspark on Windows here because it is very slow
56-
run: uv pip install -e ".[dask, modin, ibis]" --group core-tests --group extra --system
55+
# we are not testing pyspark, modin, or dask on Windows here because nobody got time for that
56+
run: uv pip install -e ".[ibis]" --group core-tests --group extra --system
5757
- name: show-deps
5858
run: uv pip freeze
5959
- name: Run pytest
6060
run: |
61-
pytest tests --cov=narwhals --cov=tests --runslow --cov-fail-under=95 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,modin[pyarrow],polars[eager],polars[lazy],dask,duckdb,sqlframe,ibis --durations=30
61+
pytest tests --cov=narwhals --cov=tests --runslow --cov-fail-under=95 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],duckdb,sqlframe,ibis --durations=30
6262
6363
pytest-full-coverage:
6464
strategy:
@@ -112,8 +112,73 @@ jobs:
112112
cache-suffix: pytest-narrower-deps-${{ matrix.python-version }}
113113
cache-dependency-glob: "pyproject.toml"
114114
- name: install-reqs
115-
run: uv pip install -e ".[pandas, pyarrow]" --group tests --system
115+
run: uv pip install -e ".[pandas]" --group tests --system
116+
- name: show-deps
117+
run: uv pip freeze
118+
- name: Run pytest
119+
run: pytest tests --runslow --constructors=pandas,pandas[nullable]
120+
- name: install-more-reqs
121+
run: uv pip install -U pyarrow --system
122+
- name: show-deps
123+
run: uv pip freeze
124+
- name: Run pytest
125+
run: pytest tests --runslow --constructors=pandas[pyarrow],pyarrow
126+
127+
python-314:
128+
strategy:
129+
matrix:
130+
python-version: ["3.14"]
131+
os: [ubuntu-latest]
132+
runs-on: ${{ matrix.os }}
133+
steps:
134+
- uses: actions/checkout@v5
135+
- uses: actions/setup-python@v6
136+
with:
137+
python-version: ${{ matrix.python-version }}
138+
- name: Install uv
139+
uses: astral-sh/setup-uv@v6
140+
with:
141+
enable-cache: "true"
142+
cache-suffix: python-314-${{ matrix.python-version }}
143+
cache-dependency-glob: "pyproject.toml"
144+
- name: install pyarrow nightly
145+
run: |
146+
uv pip uninstall pyarrow --system
147+
uv pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pyarrow -U --system
148+
- name: install-reqs
149+
# Use `--pre` as duckdb stable not compatible with 3.14
150+
run: uv pip install -e . --group tests --pre pandas polars duckdb sqlframe --system
151+
- name: show-deps
152+
run: uv pip freeze
153+
- name: Run pytest
154+
run: pytest tests --cov=narwhals --cov=tests --runslow --durations=30 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],duckdb,sqlframe --cov-fail-under=50
155+
156+
python-314t:
157+
strategy:
158+
matrix:
159+
python-version: ["3.14t"]
160+
os: [ubuntu-latest]
161+
runs-on: ${{ matrix.os }}
162+
env:
163+
PYTHON_GIL: 0
164+
steps:
165+
- uses: actions/checkout@v5
166+
- uses: actions/setup-python@v6
167+
with:
168+
python-version: ${{ matrix.python-version }}
169+
- name: Install uv
170+
uses: astral-sh/setup-uv@v6
171+
with:
172+
enable-cache: "true"
173+
cache-suffix: python-314t-${{ matrix.python-version }}
174+
cache-dependency-glob: "pyproject.toml"
175+
- name: install pyarrow nightly
176+
run: |
177+
uv pip uninstall pyarrow --system
178+
uv pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pyarrow -U --system
179+
- name: install-reqs
180+
run: uv pip install -e . --group tests --pre pandas --system
116181
- name: show-deps
117182
run: uv pip freeze
118183
- name: Run pytest
119-
run: pytest tests --runslow --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow
184+
run: pytest tests --cov=narwhals --cov=tests --runslow --durations=30 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow --cov-fail-under=50

narwhals/_arrow/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,14 @@ def zeros(n: int, /) -> pa.Int64Array:
123123
return pa.repeat(0, n)
124124

125125

126+
def native_to_narwhals_dtype(dtype: pa.DataType, version: Version) -> DType:
127+
if isinstance(dtype, pa.ExtensionType):
128+
return version.dtypes.Unknown()
129+
return native_non_extension_to_narwhals_dtype(dtype, version)
130+
131+
126132
@lru_cache(maxsize=16)
127-
def native_to_narwhals_dtype(dtype: pa.DataType, version: Version) -> DType: # noqa: C901, PLR0912
133+
def native_non_extension_to_narwhals_dtype(dtype: pa.DataType, version: Version) -> DType: # noqa: C901, PLR0912
128134
dtypes = version.dtypes
129135
if pa.types.is_int64(dtype):
130136
return dtypes.Int64()

narwhals/_compliant/typing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@
2323
from narwhals._compliant.namespace import CompliantNamespace, EagerNamespace
2424
from narwhals._compliant.series import CompliantSeries, EagerSeries
2525
from narwhals._compliant.window import WindowInputs
26+
from narwhals._native import NativeDataFrame, NativeFrame, NativeSeries
2627
from narwhals.typing import (
2728
FillNullStrategy,
2829
IntoLazyFrame,
2930
ModeKeepStrategy,
30-
NativeDataFrame,
31-
NativeFrame,
32-
NativeSeries,
3331
RankMethod,
3432
RollingInterpolationMethod,
3533
)

0 commit comments

Comments
 (0)