Repository navigation
refactor(models): remove remaining legacy db.session property wrappers on Dataset - #41647
Merged
asukaminato0721 merged 3 commits intoSep 7, 2026
Conversation
keith991001
requested review from
JohnJyong,
QuantumGhost and
laipz8200
as code owners
September 2, 2026 07:55
Contributor
Pyrefly Type Coverage
|
41tair
approved these changes
Sep 2, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Sep 2, 2026
Contributor
Author
|
Heads-up for the merge queue: the earlier queue entry was removed by the merge-queue bot with "no response for status checks" — a status-check timeout while Actions was congested, not a failing check (the PR-branch CI had fully passed before queueing, and no check has ever failed on this PR). The full suite is re-running now. @41tair when it's green again, could you re-add this to the merge queue at your convenience? Thanks! |
3 of 5 tasks
Contributor
Author
|
@asukaminato0721 gentle ping — this one is approved with all checks green and |
asukaminato0721
approved these changes
Sep 7, 2026
3 of 5 tasks
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.
Important
Summary
Part of #40372, follow-up to #41569.
Removes five more legacy
@propertyaccessors onDatasetinapi/models/dataset.pythat reach for the globaldb.sessioninternally — each a thin wrapper around an existing session-awareget_*twin, with all call sites already migrated (DatasetDetailResponseSourcecovers response validation):Dataset.created_by_account→get_created_by_account(session=...)Dataset.app_count→get_app_count(session=...)Dataset.document_count→get_document_count(session=...)Dataset.is_published→get_is_published(session=...)Dataset.doc_metadata→get_doc_metadata(session=...)Additionally converts
Dataset.available_document_count— the one accessor in this group with noget_*twin — intoget_available_document_count(*, session), keeping its query semantics unchanged.Per the #41569 CI lesson, this time the call-site sweep also covered helper-indirected validation (
dump_response(...)) and test files: none of these six are read as properties anywhere in production or tests.Deliberately not touching
Dataset.word_count/doc_form/tags(their names collide with columns on other models, so they need a per-site receiver audit first),available_segment_count, or slices claimed by other contributors.Tests
TestDatasetAvailableDocumentCountcoveringget_available_document_countagainst the realsqlite_sessionfixture (completed+enabled counted, waiting excluded).get_*twins keep their existing coverage intest_dataset_models.py(test_session_aware_dataset_getters_use_caller_session,test_dataset_detail_getters_use_caller_session), which still passes.Screenshots
N/A (backend-only refactor).
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsFrom Claude Code