Repository navigation
refactor(models): remove legacy db.session property wrappers on Dataset - #41569
Merged
asukaminato0721 merged 2 commits intoSep 1, 2026
Merged
asukaminato0721 merged 2 commits into
asukaminato0721 merged 2 commits into
Conversation
keith991001
requested review from
JohnJyong,
QuantumGhost and
laipz8200
as code owners
September 1, 2026 05:42
Contributor
Pyrefly Type Coverage
|
asukaminato0721
enabled auto-merge
September 1, 2026 05:55
asukaminato0721
previously approved these changes
Sep 1, 2026
auto-merge was automatically disabled
September 1, 2026 06:15
Head branch was pushed to by a user without write access
Contributor
Author
|
CI caught a fourth validation site my call-site sweep missed: Fixed in 81ffc00 by routing that endpoint through |
asukaminato0721
enabled auto-merge
September 1, 2026 06:26
asukaminato0721
approved these changes
Sep 1, 2026
This was referenced Sep 2, 2026
2 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 #41370 / #41440.
Removes five legacy
@propertyaccessors onDatasetinapi/models/dataset.pythat still reach for the globaldb.sessioninternally. Each of them is a thin wrapper around an existing session-awareget_*twin, and every call site has already been migrated to the twins (DatasetDetailResponseSourcefromfields/dataset_fields.pycovers the response-validation reads for all dataset detail endpoints):Dataset.total_documents→get_total_documents(session=...)Dataset.total_available_documents→get_total_available_documents(session=...)Dataset.author_name→get_author_name(session=...)Dataset.latest_process_rule→get_latest_process_rule(session=...)Dataset.external_knowledge_info→get_external_knowledge_info(session=...)I verified there are no remaining production reads of these five as properties (including implicit
from_attributes=Truereads — all three dataset-detail validation sites go throughdataset_detail_response_source).Not touching the other
Datasetproperties (some still have property readers), norDocument.*/DocumentSegment.*/ the slices claimed by other contributors on the issue.Tests
The session-aware
get_*twins already have unit coverage intests/unit_tests/models/test_dataset_models.py(test_session_aware_dataset_getters_use_caller_session,test_dataset_detail_getters_use_caller_session), which keeps passing. Updated the two container-integration tests that still readtotal_documents/total_available_documentsas properties to call theget_*twins explicitly.Screenshots
N/A (backend-only refactor).
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsFrom Claude Code