Skip to content

docs: make the README quickstart run with no edits, and check it in CI - #539

Merged
JohnnyWilson16 merged 1 commit into
mainfrom
docs/readme-quickstart-runs-jwd
Nov 28, 2026
Merged

JohnnyWilson16 merged 1 commit into
mainfrom
docs/readme-quickstart-runs-jwd

Conversation

@JohnnyWilson16

Copy link
Copy Markdown
Contributor

What changed?

  • README.md: the install line is now pip install "freshdata-cleaner[polars]". The quickstart starts from a small inline pl.LazyFrame and keeps pl.scan_parquet("s3://...") as a comment. The example output is the real output.
  • scripts/check_readme_blocks.py (new): runs each python block of a Markdown file in order, in one namespace, as a reader does.
  • .github/workflows/ci-verification-gates.yml: new job readme-code-blocks. It builds the wheel, installs it with the [polars] extra in a new venv, and runs the script with python -I outside the checkout. So the job tests the wheel, not src/.

Why?

A new user who copies the quickstart gets an error before the first freshdata call. This was cause #1 in the adoption audit.

  1. pip install freshdata-cleaner does not install Polars. Line 1 fails.
  2. With Polars, the fake s3://bucket/... path sends a real request to S3 and fails.

How was it tested?

The check is the new CI job. I ran its steps locally (Python 3.12, uv venvs, wheel built from each commit).

Before (wheel from origin/main 0e89722, README unchanged):

# plain install, as the README said
  File ".../README.md", line 38, in <module>
    import polars as pl
ModuleNotFoundError: No module named 'polars'
exit=1

# with the [polars] extra (polars 2.2.0, pyarrow 26.0.1)
OSError: object-store error: Generic S3 error: Error performing GET https://s3.ap-south-2.amazonaws.com/bucket/raw_customer_events.parquet in 39.679458ms - Server returned non-2xx status code: 400 Bad Request: ... IllegalLocationConstraintException ...
exit=1

After (wheel from this branch):

skip README.md:23 (bash)
skip README.md:31 (bash)
run  README.md:39
[column_names] Customer ID: normalize_name {'to': 'customer_id'}
[column_names] Signup Age: normalize_name {'to': 'signup_age'}
[missing] signup_age: impute_median {}
[column_names] Segment: normalize_name {'to': 'segment'}
[strings] segment: strip_strings {}
[column_names] Invoice Total: normalize_name {'to': 'invoice_total'}
[missing] invoice_total: impute_median {}
[outliers] signup_age: clip_iqr {'lower': 27.875, 'upper': 48.875}
[duplicates] *: drop_duplicates {}
run  README.md:98
+ [outliers] invoice_total: clip_iqr {'lower': 6.125, 'upper': 18.125}
skip README.md:161 (bash)
ok: 2 python block(s) ran
exit=0

freshdata.__file__ in that venv is .../site-packages/freshdata/__init__.py, so the run used the wheel.

New-user path: a fresh Python 3.14 venv, pip install "freshdata-cleaner[polars] @ file://<wheel>", then the first python block copied to a file with no edits: exit 0.

Full suite (editable install, .[dev,migrate,polars]): 94 passed, 1 warning in 12.04s, coverage 96.15%.

  • Ran ruff check on the new script (clean). ruff check . on the repo reports 112 errors, all in files this PR does not touch (same count on main).
  • mypy src/freshdata: no issues.

Any performance impact?

  • None. One new CI job, about 1 minute.

Any compatibility concerns?

  • None. No change to src/.

Known limit

The README documents the 3.x API on main. pip install freshdata-cleaner still installs 2.1.0 from PyPI, where this quickstart fails with TypeError: ColumnContract.__init__() got an unexpected keyword argument 'impute'. A separate PR prepares the 3.0.0 release. This PR makes the README match the wheel built from main.

A new user who copies the quickstart gets an error before the first
freshdata call:

- `pip install freshdata-cleaner` does not install Polars, so line 1
  fails with `ModuleNotFoundError: No module named 'polars'`.
- With Polars, `pl.scan_parquet("s3://bucket/...")` sends a request to
  real S3 and fails with `OSError: object-store error: Generic S3 error`.

The install line now names the `[polars]` extra. The quickstart starts
from a small inline LazyFrame and keeps the scan as a comment. The
example output is now the real output.

scripts/check_readme_blocks.py runs each python block of a Markdown
file in order, in one namespace. The new CI job readme-code-blocks
builds the wheel, installs it with the extra the README names, and runs
the script with `python -I` outside the checkout, so it tests the wheel
and not src/.
@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 35888daf-6cd7-4a5d-af00-3c01f8332e2a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@JohnnyWilson16
JohnnyWilson16 merged commit 53c6f8d into main Nov 28, 2026
14 checks passed
@JohnnyWilson16
JohnnyWilson16 deleted the docs/readme-quickstart-runs-jwd branch November 28, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant