Repository navigation
docs: make the README quickstart run with no edits, and check it in CI - #539
Merged
Merged
Conversation
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/.
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
README.md: the install line is nowpip install "freshdata-cleaner[polars]". The quickstart starts from a small inlinepl.LazyFrameand keepspl.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 jobreadme-code-blocks. It builds the wheel, installs it with the[polars]extra in a new venv, and runs the script withpython -Ioutside the checkout. So the job tests the wheel, notsrc/.Why?
A new user who copies the quickstart gets an error before the first freshdata call. This was cause #1 in the adoption audit.
pip install freshdata-cleanerdoes not install Polars. Line 1 fails.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/main0e89722, README unchanged):After (wheel from this branch):
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%.ruff checkon the new script (clean).ruff check .on the repo reports 112 errors, all in files this PR does not touch (same count onmain).mypy src/freshdata: no issues.Any performance impact?
Any compatibility concerns?
src/.Known limit
The README documents the 3.x API on
main.pip install freshdata-cleanerstill installs 2.1.0 from PyPI, where this quickstart fails withTypeError: 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 frommain.