Underscore-prefix methods that are not part of the public API - #92
Merged
Conversation
This was referenced Jul 20, 2026
This was referenced Jul 21, 2026
roed314
added a commit
to LMFDB/lmfdb
that referenced
this pull request
Jul 21, 2026
psycodict is underscore-prefixing methods that are not part of its public API. Rename the log_db_change override to _log_db_change (keeping the old name bound so the hook works under either psycodict), and call is_alive / can_read_write_knowls / can_read_write_userdb through version-tolerant getattr fallbacks, so this can merge before or after the psycodict change. Simplify once psycodict is pinned. The db.cursor() calls in riemann/stieltjes and zeros/zeta are sqlite3 connections, not psycodict, and are untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
roed-math
pushed a commit
to roed-math/seminars
that referenced
this pull request
Jul 21, 2026
Bind the per-table log_db_change no-op under both its old and new names, and reach cursor / can_read_write_userdb through version-tolerant fallbacks, so this works whichever psycodict is installed. Simplify once psycodict is pinned past that PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Renames, per the list in roed314#25: on the database, cursor, log_db_change, is_alive, is_read_only, can_read_write_knowls, can_read_write_userdb, register_object and the logger attribute; on tables, has_id, log_db_change and logger. The grant_* methods stay public: the issue marked them as a maybe, and they are deliberate administrative API (statstable calls grant_select when creating tables). fetch_userpassword and is_verifying from the original list live in lmfdb, not here. Fixes roed314#25. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #25.
Stacked on #89 (which stacks on #88): based on the
join-queriesbranch; once those merge this reduces to the single commit d0317ca. Independent of the other two issue PRs (#90, #91); the three merge cleanly in any order (verified locally; the combined tree passes the full suite plus devmirror).Renames, following the issue's list:
db.cursordb._cursordb.log_db_changedb._log_db_changedb.is_alivedb._is_alivedb.is_read_onlydb._is_read_onlydb.can_read_write_knowlsdb._can_read_write_knowlsdb.can_read_write_userdbdb._can_read_write_userdbdb.register_objectdb._register_objectdb.logger/table.logger_loggertable.has_idtable._has_idtable.log_db_changetable._log_db_changeJudgment calls, flagged for veto:
grant_*stay public — the issue marked them "maybe", they are deliberate administrative API, andstatstablecallsgrant_selectwhen creating tables.fetch_userpasswordandis_verifyingfrom the original list don't exist in psycodict (they are lmfdb-side; Expose fewer methods for tables LMFDB/lmfdb#3262 remains the place for those).Downstream survey (lmfdb main, seminars, psetpartners, lmfdb-lite, FiniteGroups). The only real users of the renamed names:
db.is_alive()×3 (app.py),can_read_write_knowls/can_read_write_userdb×1 each, and thelog_db_changeoverride in lmfdb_database.py. (Thedb.cursor()hits in riemann/stieltjes and zeros/zeta that a naive grep finds are sqlite3 connections nameddb, not psycodict.)log_db_changeno-op monkeypatch,db.cursor()in the copy helper,can_read_write_userdb×1.Companion PRs, both written version-tolerantly so they can merge before or after this one: LMFDB/lmfdb#7072 and roed314/seminars#978 (the seminars one verified against both psycodict versions with byte-identical copy output). The overrides keep both names bound, so the logging hooks cannot silently detach during the transition.
A new
tests/test_api.pyguards the narrowed surface (old names absent, new names present) so the public names don't quietly come back. Suite 544/24 on this branch, ruff clean; devmirror tests updated and passing.🤖 Generated with Claude Code