Skip to content

fix: handle zero-column DuckDB sources #231

fix: handle zero-column DuckDB sources

fix: handle zero-column DuckDB sources #231

Workflow file for this run

name: Notebook smoke
on:
push:
branches: [main]
paths:
- "notebooks/**"
- "src/freshdata/**"
- "pyproject.toml"
- ".github/workflows/notebooks.yml"
pull_request:
paths:
- "notebooks/**"
- "src/freshdata/**"
- "pyproject.toml"
- ".github/workflows/notebooks.yml"
workflow_dispatch:
# Cancel superseded runs only for pull requests; runs on main are grouped per
# commit so back-to-back merges each keep their notebook smoke result.
concurrency:
group: notebooks-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
cache: pip
- name: Install notebook smoke dependencies
run: |
python -m pip install --upgrade pip
pip install -e . nbclient nbformat ipykernel
python -m ipykernel install --user --name freshdata-smoke
- name: Validate notebook JSON
run: |
python - <<'PY'
from pathlib import Path
import nbformat
notebooks = sorted(Path("notebooks").rglob("*.ipynb"))
if not notebooks:
raise SystemExit("no notebooks found")
for path in notebooks:
notebook = nbformat.read(path, as_version=4)
nbformat.validate(notebook)
print(f"validated {path}")
PY
# Keep optional ML/model notebooks out of required CI. The quickstart is
# deliberately dependency-light and exercises the installed package.
- name: Execute quickstart notebook
run: |
python - <<'PY'
from pathlib import Path
import nbformat
from nbclient import NotebookClient
path = Path("notebooks/01_quickstart.ipynb")
notebook = nbformat.read(path, as_version=4)
NotebookClient(
notebook,
timeout=120,
kernel_name="freshdata-smoke",
resources={"metadata": {"path": str(path.parent)}},
).execute()
print(f"executed {path}")
PY