Skip to content

feat: Add maintain_order argument to {Expr, Series}.list.unique #4120

feat: Add maintain_order argument to {Expr, Series}.list.unique

feat: Add maintain_order argument to {Expr, Series}.list.unique #4120

Workflow file for this run

name: PyTest PySpark constructor
on:
pull_request:
paths:
- .github/workflows/pytest-pyspark.yml
- src/narwhals/_expression_parsing.py
- src/narwhals/_spark_like/**
- src/narwhals/_sql/**
- tests/*scan*.py
- tests/frame/*sink*.py
- pyproject.toml
- uv.lock
workflow_call:
schedule:
- cron: 0 12 * * 0 # Sunday at mid-day
env:
PY_COLORS: 1
PYTEST_ADDOPTS: "--numprocesses=logical"
UV_LOCKED: 1
UV_NO_DEV: 1
permissions:
contents: read
jobs:
pytest-pyspark-constructor:
if: github.head_ref != 'bump-version'
strategy:
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: "true"
cache-suffix: pyspark-${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
- name: Run pytest
run: make run-ci DEPS="--group core-tests --extra pyspark --extra pandas" CMD="pytest tests --cov=src/narwhals/_spark_like --cov-fail-under=95 --runslow --constructors=pyspark"
pytest-pyspark-min-version-constructor:
if: github.head_ref != 'bump-version'
strategy:
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: "true"
cache-suffix: pyspark-min-${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
- name: Run pytest
run: make run-ci DEPS="--group min-pyspark-version --extra pandas" CMD="pytest tests --cov=src/narwhals/_spark_like --cov-fail-under=95 --runslow --constructors=pyspark"
pytest-pyspark-connect-constructor:
if: github.head_ref != 'bump-version'
strategy:
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
env:
SPARK_VERSION: 4.1.0
SPARK_PORT: 15002
SPARK_CONNECT: true
runs-on: ${{ matrix.os }}
container:
# env context isn't available here (https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability), so this must match SPARK_VERSION
image: apache/spark:4.1.0
options: --user root
env:
HOME: /root
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: "true"
cache-suffix: pyspark-connect-${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
- name: Create venv
run: uv venv --python ${{ matrix.python-version }}
- name: install-reqs
# temporary pin to get CI green
run: uv pip install -e ".[pandas]" --group core-tests --group sklearn "pyarrow<22.0"
- name: install pyspark
run: uv pip install -e . "pyspark[connect]==${SPARK_VERSION}" "setuptools<78"
- name: show-deps
run: uv pip freeze
- name: Start Spark Connect server
run: |
/opt/spark/sbin/start-connect-server.sh --master 'local[*]' --conf spark.connect.grpc.binding.port=${SPARK_PORT}
sleep 5
echo "Spark Connect server started"
- name: Run pytest
run: uv run --no-sync pytest tests --cov=src/narwhals/_spark_like --cov-fail-under=95 --runslow --constructors "pyspark[connect]"
- name: Stop Spark Connect server
if: always()
run: /opt/spark/sbin/stop-connect-server.sh