Repository navigation
refactor(models): remove legacy db.session property wrappers on DocumentSegment and DatasetQuery - #41794
Merged
asukaminato0721 merged 1 commit intoSep 7, 2026
Conversation
…entSegment and DatasetQuery
keith991001
requested review from
JohnJyong,
QuantumGhost and
laipz8200
as code owners
September 4, 2026 05:32
Contributor
Pyrefly Type Coverage
|
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 #41721.
Removes five legacy
@propertyaccessors inapi/models/dataset.pythat reach for the globaldb.sessioninternally — each a thin wrapper around an existing session-awareget_*twin with no remaining property reads (checked production receivers, serializerfrom_attributesreads —SegmentWithSummaryand the hit-testing flow already use explicit session paths — helper-indirecteddump_responsesites, tests, and intra-model consumers):DocumentSegment.dataset→get_dataset(session=...)DocumentSegment.document→get_document(session=...)DocumentSegment.child_chunks→get_child_chunks(session=...)DocumentSegment.attachments→get_attachments(session=...)DatasetQuery.queries→get_queries(session=...)Scope note: the claim originally included
ExternalKnowledgeApis.dataset_bindings, but its ownto_dict()still consumes the property (caught by type-check), putting it in the sameto_dict-deep-water group asDocument.segment_count/hit_count/dataset_process_rulefrom #41721. It is left untouched and unclaimed.Tests
Updated the two container-integration tests that read
segment.dataset/segment.documentas properties to call theget_*twins with the test session. The twins keep their existing unit coverage (get_child_chunks/get_attachmentsare exercised viaSegmentWithSummarytests), all passing.Screenshots
N/A (backend-only refactor).
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsFrom Claude Code