Skip to content

Commit f5f2798

Browse files
committed
Merge remote-tracking branch 'upstream/main' into simp-pandas-group-by
2 parents cf5285c + 54bf3d3 commit f5f2798

Some content is hidden

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

90 files changed

+936
-1266
lines changed

.github/workflows/downstream_tests.yml

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: astral-sh/setup-uv@v6
2626
with:
2727
enable-cache: "true"
28-
cache-suffix: ${{ matrix.python-version }}
28+
cache-suffix: altair-${{ matrix.python-version }}
2929
cache-dependency-glob: "pyproject.toml"
3030
- name: clone-altair
3131
run: |
@@ -72,7 +72,7 @@ jobs:
7272
uses: astral-sh/setup-uv@v6
7373
with:
7474
enable-cache: "true"
75-
cache-suffix: ${{ matrix.python-version }}
75+
cache-suffix: marimo-${{ matrix.python-version }}
7676
cache-dependency-glob: "pyproject.toml"
7777
- name: clone-marimo
7878
run: |
@@ -86,8 +86,6 @@ jobs:
8686
run: |
8787
cd marimo
8888
. .venv/bin/activate
89-
# temporary to get CI green
90-
uv pip install "panel<1.6.1"
9189
uv pip install -e ".[dev]"
9290
which python
9391
- name: install-narwhals-dev
@@ -135,7 +133,7 @@ jobs:
135133
uses: astral-sh/setup-uv@v6
136134
with:
137135
enable-cache: "true"
138-
cache-suffix: ${{ matrix.python-version }}
136+
cache-suffix: sklego-${{ matrix.python-version }}
139137
cache-dependency-glob: "pyproject.toml"
140138
- name: clone-scikit-lego
141139
run: git clone https://github.com/koaning/scikit-lego.git --depth 1
@@ -172,30 +170,41 @@ jobs:
172170
uses: astral-sh/setup-uv@v6
173171
with:
174172
enable-cache: "true"
175-
cache-suffix: ${{ matrix.python-version }}
173+
cache-suffix: shiny-${{ matrix.python-version }}
176174
cache-dependency-glob: "pyproject.toml"
177175
- name: clone-shiny
178176
run: |
179177
git clone https://github.com/posit-dev/py-shiny.git
180178
cd py-shiny
179+
uv venv -p ${{ matrix.python-version }}
181180
git log
182181
- name: install-basics
183-
run: uv pip install --upgrade tox virtualenv setuptools --system
182+
run: |
183+
cd py-shiny
184+
. .venv/bin/activate
185+
uv pip install --upgrade tox virtualenv setuptools
184186
- name: install-shiny-dev
185-
env:
186-
UV_SYSTEM_PYTHON: 1
187187
run: |
188188
cd py-shiny
189+
. .venv/bin/activate
190+
# temporary to get CI green
191+
uv pip install "chatlas<0.9.0"
189192
make narwhals-install-shiny
190193
- name: install-narwhals-dev
191194
run: |
192-
uv pip uninstall narwhals --system
193-
uv pip install -e . --system
195+
cd py-shiny
196+
. .venv/bin/activate
197+
uv pip uninstall narwhals
198+
uv pip install -e ./..
194199
- name: show-deps
195-
run: uv pip freeze
200+
run: |
201+
cd py-shiny
202+
. .venv/bin/activate
203+
uv pip freeze
196204
- name: Run `make narwhals-test-integration`
197205
run: |
198206
cd py-shiny
207+
. .venv/bin/activate
199208
# Isort seems to behave slightly differently in CI
200209
# so we ignore its output
201210
make format -s
@@ -221,7 +230,7 @@ jobs:
221230
uses: astral-sh/setup-uv@v6
222231
with:
223232
enable-cache: true
224-
cache-suffix: ${{ matrix.python-version }}
233+
cache-suffix: tea-tasting-${{ matrix.python-version }}
225234
cache-dependency-glob: "pyproject.toml"
226235
python-version: ${{ matrix.python-version }}
227236
- name: install-tea-tasting-test
@@ -260,7 +269,7 @@ jobs:
260269
uses: astral-sh/setup-uv@v6
261270
with:
262271
enable-cache: "true"
263-
cache-suffix: ${{ matrix.python-version }}
272+
cache-suffix: tubular-${{ matrix.python-version }}
264273
cache-dependency-glob: "pyproject.toml"
265274
- name: clone-tubular
266275
run: |
@@ -302,7 +311,7 @@ jobs:
302311
uses: astral-sh/setup-uv@v6
303312
with:
304313
enable-cache: "true"
305-
cache-suffix: ${{ matrix.python-version }}
314+
cache-suffix: plotly-${{ matrix.python-version }}
306315
cache-dependency-glob: "pyproject.toml"
307316
- name: clone-plotly
308317
run: |
@@ -347,7 +356,7 @@ jobs:
347356
uses: astral-sh/setup-uv@v6
348357
with:
349358
enable-cache: "true"
350-
cache-suffix: ${{ matrix.python-version }}
359+
cache-suffix: hierarchicalforecast-${{ matrix.python-version }}
351360
cache-dependency-glob: "pyproject.toml"
352361
- name: clone-hierarchicalforecast
353362
run: |
@@ -389,7 +398,7 @@ jobs:
389398
uses: astral-sh/setup-uv@v6
390399
with:
391400
enable-cache: "true"
392-
cache-suffix: ${{ matrix.python-version }}
401+
cache-suffix: formulaic-${{ matrix.python-version }}
393402
cache-dependency-glob: "pyproject.toml"
394403
- name: clone-formulaic
395404
run: |
@@ -433,7 +442,7 @@ jobs:
433442
uses: astral-sh/setup-uv@v6
434443
with:
435444
enable-cache: "true"
436-
cache-suffix: ${{ matrix.python-version }}
445+
cache-suffix: pointblank-${{ matrix.python-version }}
437446
cache-dependency-glob: "pyproject.toml"
438447
- name: clone-pointblank
439448
run: |
@@ -445,17 +454,28 @@ jobs:
445454
- name: install-deps
446455
run: |
447456
cd pointblank
448-
uv pip install . --group dev --system
449-
uv pip install pytest pytest-cov pytest-snapshot pandas polars "ibis-framework[duckdb,mysql,postgres,sqlite]>=9.5.0" chatlas shiny --system
457+
uv venv -p ${{ matrix.python-version }}
458+
. .venv/bin/activate
459+
uv pip install . --group dev
460+
uv pip install pytest pytest-cov pytest-snapshot pandas polars "ibis-framework[duckdb,mysql,postgres,sqlite]>=9.5.0" chatlas shiny
450461
- name: install-narwhals-dev
451462
run: |
452-
uv pip uninstall narwhals --system
453-
uv pip install -e . --system
463+
cd pointblank
464+
. .venv/bin/activate
465+
uv pip uninstall narwhals
466+
uv pip install -e .
454467
- name: show-deps
455-
run: uv pip freeze
468+
run: |
469+
cd pointblank
470+
. .venv/bin/activate
471+
uv pip freeze
456472
- name: Run tests
457473
run: |
458474
cd pointblank
475+
. .venv/bin/activate
476+
# make sure that we use the .venv when running tests, so that
477+
# the local narwhals install is picked up
478+
sed -i 's/uv run pytest/uv run --no-sync pytest/g' Makefile
459479
make test
460480
461481
validoopsie:
@@ -473,7 +493,7 @@ jobs:
473493
uses: astral-sh/setup-uv@v6
474494
with:
475495
enable-cache: "true"
476-
cache-suffix: ${{ matrix.python-version }}
496+
cache-suffix: validoopsie-${{ matrix.python-version }}
477497
cache-dependency-glob: "pyproject.toml"
478498
- name: clone-validoopsie
479499
run: |
@@ -520,7 +540,7 @@ jobs:
520540
uses: astral-sh/setup-uv@v6
521541
with:
522542
enable-cache: "true"
523-
cache-suffix: ${{ matrix.python-version }}
543+
cache-suffix: darts-${{ matrix.python-version }}
524544
cache-dependency-glob: "pyproject.toml"
525545
- name: clone-darts
526546
run: |

.github/workflows/extremes.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: astral-sh/setup-uv@v6
2323
with:
2424
enable-cache: "true"
25-
cache-suffix: ${{ matrix.python-version }}
25+
cache-suffix: min-versions-${{ matrix.python-version }}
2626
cache-dependency-glob: "pyproject.toml"
2727
- name: install-minimum-versions
2828
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.3 polars==0.20.4 numpy==1.19.3 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.6.0 scikit-learn==1.1.0 duckdb==1.0 tzdata --system
@@ -59,7 +59,7 @@ jobs:
5959
uses: astral-sh/setup-uv@v6
6060
with:
6161
enable-cache: "true"
62-
cache-suffix: ${{ matrix.python-version }}
62+
cache-suffix: pretty-old-versions-${{ matrix.python-version }}
6363
cache-dependency-glob: "pyproject.toml"
6464
- name: install-pretty-old-versions
6565
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.4 numpy==1.19.3 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.6.0 scikit-learn==1.1.0 duckdb==1.0 tzdata --system
@@ -97,7 +97,7 @@ jobs:
9797
uses: astral-sh/setup-uv@v6
9898
with:
9999
enable-cache: "true"
100-
cache-suffix: ${{ matrix.python-version }}
100+
cache-suffix: not-so-old-versions-${{ matrix.python-version }}
101101
cache-dependency-glob: "pyproject.toml"
102102
- name: install-not-so-old-versions
103103
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
@@ -134,7 +134,7 @@ jobs:
134134
uses: astral-sh/setup-uv@v6
135135
with:
136136
enable-cache: "true"
137-
cache-suffix: ${{ matrix.python-version }}
137+
cache-suffix: nightlies-${{ matrix.python-version }}
138138
cache-dependency-glob: "pyproject.toml"
139139
- name: install-reqs
140140
run: uv pip install -e . --group tests --system

.github/workflows/publish_to_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
name: python-package-distributions
7777
path: dist/
7878
- name: Sign the dists with Sigstore
79-
uses: sigstore/[email protected].0
79+
uses: sigstore/[email protected].1
8080
with:
8181
inputs: >-
8282
./dist/*.tar.gz

.github/workflows/pytest-pyspark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: astral-sh/setup-uv@v6
2626
with:
2727
enable-cache: "true"
28-
cache-suffix: ${{ matrix.python-version }}
28+
cache-suffix: pyspark-${{ matrix.python-version }}
2929
cache-dependency-glob: "pyproject.toml"
3030
- name: install-reqs
3131
run: uv pip install -e . --group core-tests --group extra --system
@@ -58,7 +58,7 @@ jobs:
5858
uses: astral-sh/setup-uv@v6
5959
with:
6060
enable-cache: "true"
61-
cache-suffix: ${{ matrix.python-version }}
61+
cache-suffix: pyspark-connect-${{ matrix.python-version }}
6262
cache-dependency-glob: "pyproject.toml"
6363

6464
- name: Install Java 17

.github/workflows/pytest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: astral-sh/setup-uv@v6
2525
with:
2626
enable-cache: "true"
27-
cache-suffix: ${{ matrix.python-version }}
27+
cache-suffix: pytest-39-${{ matrix.python-version }}
2828
cache-dependency-glob: "pyproject.toml"
2929
- name: install-reqs
3030
run: uv pip install -e ".[pandas,polars,pyarrow]" --group tests --system
@@ -48,7 +48,7 @@ jobs:
4848
uses: astral-sh/setup-uv@v6
4949
with:
5050
enable-cache: "true"
51-
cache-suffix: ${{ matrix.python-version }}
51+
cache-suffix: pytest-windows-${{ matrix.python-version }}
5252
cache-dependency-glob: "pyproject.toml"
5353
- name: install-reqs
5454
# we are not testing pyspark on Windows here because it is very slow
@@ -79,7 +79,7 @@ jobs:
7979
uses: astral-sh/setup-uv@v6
8080
with:
8181
enable-cache: "true"
82-
cache-suffix: ${{ matrix.python-version }}
82+
cache-suffix: pytest-full-coverage-${{ matrix.python-version }}
8383
cache-dependency-glob: "pyproject.toml"
8484
- name: install-reqs
8585
run: uv pip install -e ".[dask, modin, ibis]" --group core-tests --group extra --system
@@ -110,7 +110,7 @@ jobs:
110110
uses: astral-sh/setup-uv@v6
111111
with:
112112
enable-cache: "true"
113-
cache-suffix: ${{ matrix.python-version }}
113+
cache-suffix: pytest-narrower-deps-${{ matrix.python-version }}
114114
cache-dependency-glob: "pyproject.toml"
115115
- name: install-reqs
116116
run: uv pip install -e ".[pandas, pyarrow]" --group tests --system

.github/workflows/random_ci_pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: astral-sh/setup-uv@v6
2424
with:
2525
enable-cache: "true"
26-
cache-suffix: ${{ matrix.python-version }}
26+
cache-suffix: pytest-random-ci-${{ matrix.python-version }}
2727
cache-dependency-glob: "pyproject.toml"
2828
- name: generate-random-versions
2929
run: python utils/generate_random_versions.py

.github/workflows/typing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: astral-sh/setup-uv@v6
2525
with:
2626
enable-cache: "true"
27-
cache-suffix: ${{ matrix.python-version }}
27+
cache-suffix: typing-${{ matrix.python-version }}
2828
cache-dependency-glob: "pyproject.toml"
2929
- name: Create venv
3030
run: uv venv .venv

docs/how_it_works.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ from narwhals._utils import parse_version, Version
7474

7575
pn = PandasLikeNamespace(
7676
implementation=Implementation.PANDAS,
77-
backend_version=parse_version(pd.__version__),
7877
version=Version.MAIN,
7978
)
8079
print(nw.col("a")._to_compliant_expr(pn))
@@ -101,15 +100,13 @@ import pandas as pd
101100

102101
pn = PandasLikeNamespace(
103102
implementation=Implementation.PANDAS,
104-
backend_version=parse_version(pd.__version__),
105103
version=Version.MAIN,
106104
)
107105

108106
df_pd = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
109107
df = PandasLikeDataFrame(
110108
df_pd,
111109
implementation=Implementation.PANDAS,
112-
backend_version=parse_version(pd.__version__),
113110
version=Version.MAIN,
114111
validate_column_names=True,
115112
)
@@ -199,7 +196,6 @@ import pandas as pd
199196

200197
pn = PandasLikeNamespace(
201198
implementation=Implementation.PANDAS,
202-
backend_version=parse_version(pd.__version__),
203199
version=Version.MAIN,
204200
)
205201

@@ -214,7 +210,6 @@ backend, and it does so by passing a Narwhals-compliant namespace to `nw.Expr._t
214210
```python exec="1" result="python" session="pandas_api_mapping" source="above"
215211
pn = PandasLikeNamespace(
216212
implementation=Implementation.PANDAS,
217-
backend_version=parse_version(pd.__version__),
218213
version=Version.MAIN,
219214
)
220215
expr = (nw.col("a") + 1)._to_compliant_expr(pn)

0 commit comments

Comments
 (0)