Cover the untested options, and require pandas 2.1 - #91
Merged
Merged
Conversation
These were all documented behaviour without a test: - select_readers: only the selected readers replace their tag, and an unknown reader name is a configuration error - allow_missing_files: a missing table is a warning instead of an error, the fixture for it already existed but was never used - indentation: a table keeps the indentation of its tag, so it ends up inside an admonition or content tab instead of after it - malformed tags are left alone, bad_tags.md was built but never checked - inserted content is not searched for tags itself, since every tag is replaced in a single pass Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFvwQmcc3ekHM351Y5aQeG
Nothing has imported it since the plugin stopped changing directories. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFvwQmcc3ekHM351Y5aQeG
Both tests skipped everywhere, including CI, because pytables and pyreadstat were not dev dependencies. read_hdf_file() had therefore never run at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFvwQmcc3ekHM351Y5aQeG
The fallback was dead code: it is guarded by a string comparison of pd.__version__, and pd.DataFrame.applymap() no longer exists in pandas 3. pd.DataFrame.map(), which replaced it, was added in pandas 2.1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFvwQmcc3ekHM351Y5aQeG
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFvwQmcc3ekHM351Y5aQeG
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.
Fills the gaps I found while reviewing the test suite. Line coverage goes from 94% to 100%, and 56 tests run with none skipped (was 45 passing, 2 permanently skipped).
Tests added
test_select_readers,test_select_readers_unknownread_jsontag is left literal, and an unknown reader name aborts with a configuration error. New fixturetests/fixtures/select_readers/.test_allow_missing_fileswrongpath/mkdocs_allow_missing.ymlexisted but nothing referenced it. Asserts the build succeeds, the tag becomes{{ Cannot find '...' }}and other tables still render.test_indentationtests/fixtures/indentation/.test_tags_in_inserted_contentread_rawfile that itself contains a tag comes through as-is, which is what the single-pass substitution guarantees. If it were ever re-scanned the build would fail on the missing file.test_malformed_tagsbad_tags.mdwas being built but never asserted on.test_add_indentation,test_add_indentation_spaces_and_tabs,test_fix_indentationValueErrorwhen both are given, and the round-down-to-4-spaces rule.I mutation-checked the two load-bearing ones: breaking
fix_indentationfailstest_indentationandtest_fix_indentation, and dropping the reader filter failstest_select_readers.Tests that existed but never ran
test_read_hdfandtest_read_spssskipped on every platform and every Python version, becausetablesandpyreadstatwere not dev dependencies — soread_hdf_file()had never actually run. Both are dev dependencies now and both tests pass.Breaking change: pandas 2.1 is now the minimum
convert_to_md_table()picked between.map()and.applymap()on a string comparison ofpd.__version__, which is also why"10.0.0" >= "2.1.0"would have been False. The.applymap()arm was unreachable in practice: the method was removed in pandas 3, so it could only ever have run on a pandas old enough to still have it. Dropped the branch and raised the floor topandas>=2.1, the release that addedpd.DataFrame.map().Also
utils.cd, which nothing imports.🤖 Generated with Claude Code
https://claude.ai/code/session_01BFvwQmcc3ekHM351Y5aQeG