v0.5.0 — robust remote caching, pandas 3.0 support, comprehensive tutorials & demo GIF#31
Conversation
…/docs cleanup Caching (headline fix): - get_extension() now strips URL query strings/fragments so Dropbox/Drive-style links (e.g. ...npz?dl=1) cache under a clean, stable name and reload from cache instead of re-downloading (previously raised "Unknown datatype: npz?dl=1"). Correctness fixes: - apply_defaults no longer KeyErrors for names absent from config.ini (had broken TSNE/MDS/Isomap) - apply_stacked no longer crashes on return_model=True with unstacked input - is_multiindex_dataframe no longer AttributeErrors on Polars frames - removed dead npz-unwrap branch in io.load; fixed two missing f-string prefixes in zoo.text Tests (+14): - caching regressions, return_model contract, Polars helpers, backend config, io.save/load round-trips, value-based CSV assertions Docs & hygiene: - version 0.4.0 -> 0.5.0 (setup.py + configurator); fixed stale/broken bumpversion config - fixed corrupted tutorial notebook cells, @interpolate misuse, out-of-order vars - clean Sphinx build (0 warnings): docstrings, RST, notebook lexer/headings, API stubs - flake8 912 -> 0 (max-line-length=120); removed dead text_lazy.py/text_original.py - added hierarchical AGENTS.md docs; refreshed CLAUDE.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#29: __version__ is now read from the installed package metadata (importlib.metadata), making setup.py the single source of truth so it can never drift from the __version__ attribute again. Falls back to a literal only for un-installed source checkouts. #30: type detection no longer relies on pandas' internal __module__ strings, which pandas 3.0 flattened ('pandas.core.frame' -> 'pandas', 'pandas.core.indexes.multi' -> 'pandas'). This had made is_dataframe / is_multiindex_dataframe return False for real pandas objects under pandas 3.0, cascading into stack/unstack raising "Unsupported datatype". Now: - is_dataframe uses isinstance(x, pd.DataFrame) (+ a modin module guard) - is_multiindex_dataframe uses isinstance(x.index, pd.MultiIndex) - panda_handler passes through via isinstance(x, pd.DataFrame) - dataframe_like no longer requires DataFrame.backfill/.pad (removed in pandas 3.0) All stable across pandas 2.x and 3.0. Verified in an isolated pandas 3.0.0 / py3.12 venv (the issue's exact reproduction now passes; 30/30 core tests green under pandas 3.0). Also: declare pyarrow in requirements.txt (polars<->pandas conversion needs it; surfaced by the clean pandas-3.0 environment), and add scripts/verify_functions.py, a runnable smoke test that exercises every major public function on real inputs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scripts/make_demo_gif.py renders a terminal-style animated GIF (docs/images/demo.gif) from REAL datawrangler calls and their real outputs -- array->DataFrame, the Polars backend, sentence-transformers text embeddings, and the @funnel decorator. Embedded near the top of README.rst. 900x560, 134 frames, ~0.5 MB. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Filled all gaps in the issue-#5 checklist across 7 tutorial notebooks: - wrangle each datatype (dataframe, array, text, image, mixed list), shown both in-memory and loaded from a saved file - text: multiple sklearn models on built-in corpora (minipedia/sotus), a HuggingFace corpus (cam-cst/cbt), sentence-transformers models (MiniLM, mpnet), and an explicit sklearn-vectorization vs. pretrained-embedding contrast - interpolation and imputation (interp_kwargs / impute_kwargs) - decorators: list_generalizer, funnel, stack/unstack (with why-useful), apply_stacked/unstacked - io: load local + remote, save - util: btwn, dataframe_like/array_like, load_dataframe (csv AND json) - core: config.ini structure/customization, get_default_options, apply_defaults Also fixed 3 pre-existing NameErrors that broke top-to-bottom execution. All 7 edited notebooks execute cleanly (0 error outputs across 205 cells) and were re-verified with an independent kernel; Sphinx build stays warning-free. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…11/3.12) int() on an ndim>0 (1x1) array raises "only 0-dimensional arrays can be converted to Python scalars" under numpy 2.x (a DeprecationWarning in older numpy, a hard error in the numpy pulled in by pandas 3.0 on Python 3.11/3.12). Extract the scalar with .item(), which is stable across numpy versions. The assertions are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Manual verification — every user-facing surface (input → output)Method. Beyond the automated pytest suite, I exercised each public surface by hand with real calls and examined the actual outputs. The exact input ( 1) Full public API — pandas 2.3.3Top-level API —
|
Replaced the toy demos with real, larger-scale ones (all measured/computed live, nothing faked): - Polars sort of 20,000,000 rows (60M values) benchmarked vs pandas -> ~8x faster - real NLP: wrangle news headlines into sentence embeddings, then cosine similarity showing the finance vs cooking sentences cluster by topic - @funnel applied to a raw numpy array (function written for DataFrames) - IterativeImputer filling missing sensor readings Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Demo GIF upgraded (issue #8, follow-up)
205 frames, ~1.0 MB, 900×560. Regenerate any time with |
Overview
Release v0.5.0 of
pydata-wrangler: a robust remote-caching fix, a batch of correctness fixes, a full lint/docs/test cleanup, and resolution of four tracked issues (#5, #8, #29, #30). Everything is green — full test suite, flake8, and a warning-free Sphinx build — and every major public function has been exercised on real inputs with the outputs examined.Closes #5. Closes #8. Closes #29. Closes #30.
Headline fix — remote-file caching
get_extension()now strips URL query strings/fragments, so Dropbox/Drive-style links like…/minipedia.npz?dl=1(including the built-in text corpora) cache under a clean, stable name and reload from cache. Previously they were cached as<hash>.npz?dl=1and then failed to reload (ValueError: Unknown datatype: npz?dl=1), silently re-downloading each time.Tracked issues
#30 — pandas 3.0 breaks type detection →
stack/unstackfailis_dataframe/is_multiindex_dataframe/panda_handlermatched pandas' internal__module__strings, which pandas 3.0 flattened (pandas.core.frame→pandas). Replaced withisinstancechecks (stable across pandas 2.x/3.0); also droppedDataFrame.backfill/.padfromdataframe_like(removed in pandas 3.0).Direct evidence — isolated pandas 3.0.0 / Python 3.12 venv:
Also green on pandas 2.3.3. Regression test added (
test_issue30_pandas_type_detection).#29 —
__version__reported the wrong version__version__is now read from the installed package metadata (importlib.metadata), makingsetup.pythe single source of truth (with a literal fallback only for un-installed source checkouts). Also fixed the silently-brokenbumpversionconfig that caused the original drift.dw.__version__ == metadata.version('pydata-wrangler') == 0.5.0. Regression test added.#8 — demo GIF for the README
scripts/make_demo_gif.pyrenders a terminal-style animated GIF from realdatawranglercalls/outputs (array→DataFrame, Polars backend, sentence-transformers embeddings,@funnel).docs/images/demo.gif(900×560, 134 frames, ~0.5 MB), embedded in the README.#5 — comprehensive tutorials
Filled every gap in the issue checklist across 7 tutorial notebooks (each supported datatype in-memory + from file; sklearn vectorization vs. sentence-transformers embedding; built-in + HuggingFace corpora; interpolation/imputation; all decorators incl. stack/unstack + apply_stacked/unstacked; io local/remote/save; util; core/config.ini). Fixed 3 pre-existing NameErrors that broke top-to-bottom execution. All 7 edited notebooks execute cleanly (0 error outputs) and re-verified with an independent kernel.
Correctness fixes (from a full package audit)
apply_defaultsno longerKeyErrors for names absent fromconfig.ini(had broken sklearn TSNE/MDS/Isomap).apply_stackedno longer crashes onreturn_model=Truewith unstacked input.zoo.text.Tests, lint, docs
return_modelcontract, Polars helpers, backend config,io.save/loadround-trips, value-based assertions, and datawrangler.__version__ reports incorrect version #29/pandas 3.0 support: type(x).__module__ string-matching breaks is_dataframe / is_multiindex_dataframe (→ stack/unstack fail) #30 regressions).max-line-length = 120set explicitly; removed genuinely-unused imports,type==→is, bare-except→except Exception, etc.).sphinx -E -abuild (docstrings, RST, notebook lexer/heading fixes, new API stubs). Removed two dead duplicate modules (text_lazy.py,text_original.py).AGENTS.mddocs and a runnablescripts/verify_functions.pysmoke test.Comprehensive direct evidence (real calls, outputs examined)
python scripts/verify_functions.pyexercises every major public function; representative outputs:🤖 Generated with Claude Code