Skip to content

Pin the dependency set, replace the dead profiler, stop a test destroying data - #19

Merged
Varnasr merged 1 commit into
mainfrom
claude/dev-tools-repo-structure-kw19mh
Sep 8, 2026
Merged

Varnasr merged 1 commit into
mainfrom
claude/dev-tools-repo-structure-kw19mh

Conversation

@Varnasr

@Varnasr Varnasr commented Sep 8, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Three things, all found by installing and running rather than by reading.

requirements.txt was entirely unpinned on a repository marked Stable. The maintenance policy asks that a clone still run years from now, and an unpinned set on a repository nobody is watching is a CI failure waiting for a quiet week. Every version is now pinned, resolved together, and verified on Python 3.11 with the suite green.

pandas-profiling is worse than deprecated. The maintainers renamed it to ydata-profiling at version 4 and no longer publish the old name. On Python 3.11 it does not install at all: its htmlmin dependency cannot build a wheel. CI survived only because it pinned Python 3.10. eda/profile_data_quick.py imported it at module scope, so that module was one Python bump away from being unimportable. Swapped for ydata-profiling==4.18.4, verified installing and importing in a clean virtualenv, and the workflow moves to 3.11 so what CI runs is what was tested.

A test was destroying committed data. tests/test_read_large_csv_chunked.py opened sample_data/gender_sample.csv in write mode and overwrote it with a,b\n1,2\n3,4\n5,6. Every run of the suite destroyed the sample file; it survived only because nobody ever committed the damage. I found it staged in my own working tree. It now uses pytest's tmp_path, and a second test asserts the sample file's hash is unchanged after a run so this cannot come back quietly. test_export_formatted_excel.py wrote into the repository root and removed the file afterwards, which leaves it behind whenever the assertion fails; also moved to tmp_path.

A correction to #18

#18 said the R reference values were hardcoded into the test suite. The cross-validation against R's survey 4.2.1 was genuinely run and agreed to twelve significant figures, but the commit that landed did not include the test, so main has been carrying the claim without the guard. This PR adds it, against a dataset built with no random number generator so the reference values stay valid across library versions.

README.md also claimed scikit-learn as a key dependency; it is neither declared nor imported anywhere. Corrected along with the rest of that list.

Type of change

  • Bug fix (broken link, layout, JS error)
  • New content (course, case study, translation)
  • New feature or tool
  • Accessibility improvement
  • Performance improvement
  • Documentation update

Checklist

  • 26 tests green against the exact pinned requirements.txt, in a clean virtualenv on Python 3.11
  • ydata-profiling verified installing and importing from a fresh venv; eda/profile_data_quick.py confirmed importable again
  • pandas-profiling failure reproduced, not assumed: ERROR: Failed building wheel for htmlmin
  • sample_data/ confirmed unmodified after a full suite run
  • CLAUDE.md records the pinning rationale and the pydantic @validator deprecation that will bite whoever raises pydantic to 3
  • Browser testing not applicable, no UI in this change

🤖 Generated with Claude Code

https://claude.ai/code/session_01DMYhECx2Dzbqad6KJxWZ7t


Generated by Claude Code

…ying data

Three things, all found by actually installing and running rather than reading.

requirements.txt was entirely unpinned on a repository marked Stable. The
maintenance policy asks that a clone still run years from now, and an unpinned
set nobody is watching is a CI failure waiting for a quiet week. Every version
here was resolved together and verified on Python 3.11 with the suite green.

pandas-profiling is worse than deprecated. The maintainers renamed it to
ydata-profiling at version 4 and no longer publish the old name; on Python 3.11
it fails to install outright, because its htmlmin dependency cannot build a
wheel. CI survived only because it pinned Python 3.10. eda/profile_data_quick.py
imported it at module scope, so that module was one Python bump from being
unimportable. Swapped for ydata-profiling 4.18.4, verified installing and
importing in a clean virtualenv, and the workflow moves to 3.11 so what CI runs
is what was tested.

tests/test_read_large_csv_chunked.py opened sample_data/gender_sample.csv in
write mode and overwrote the committed sample data with "a,b\n1,2\n3,4\n5,6".
Every run of the suite destroyed it. It survived only because nobody committed
the damage; I found it staged in my own working tree. It now writes to pytest's
tmp_path, and a second test asserts the sample file's hash is unchanged after a
run, so this cannot come back quietly.
test_export_formatted_excel.py wrote into the repository root and removed the
file afterwards, which leaves it behind whenever the assertion fails. Also moved
to tmp_path.

Also here: the regression test pinning survey_estimation to R's survey 4.2.1.
The cross-validation was run last session and agreed to twelve significant
figures, but the commit that landed did not include the test, so main carried
the claim without the guard. It does now, against a dataset built with no random
number generator so the reference values stay valid across library versions.

README claimed scikit-learn as a key dependency; it is neither declared nor
imported anywhere. Corrected, along with the rest of that list.

26 tests green against the exact pinned file.

CLAUDE.md records the pinning rationale, the pydantic @validator deprecation
that will bite whoever raises pydantic to 3, the invariants that must be re-run
before touching the estimator, and the owner's design reference for UI work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMYhECx2Dzbqad6KJxWZ7t
@Varnasr
Varnasr merged commit ba63b4a into main Sep 8, 2026
1 check passed
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.

2 participants