Repository navigation
refactor(dataset): replace available_segment_count property with get_available_segment_count(session) - #42523
Merged
asukaminato0721 merged 4 commits intoSep 21, 2026
Conversation
…available_segment_count(session)
Ultroncn
requested review from
JohnJyong,
QuantumGhost and
laipz8200
as code owners
September 18, 2026 16:50
Contributor
Pyrefly Type Coverage
|
asukaminato0721
enabled auto-merge
September 18, 2026 18:57
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #42523 +/- ##
=======================================
Coverage 87.58% 87.58%
=======================================
Files 5471 5471
Lines 318391 318384 -7
Branches 63816 63813 -3
=======================================
- Hits 278871 278866 -5
+ Misses 34129 34127 -2
Partials 5391 5391
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
asukaminato0721
approved these changes
Sep 21, 2026
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.
Related issue
Part of #40372
Summary
Dataset.available_segment_countis the last@propertyinapi/models/dataset.pythat reads from the globaldb.session. This PR replaces it with an explicit-session method, matching theget_*convention already used by all its neighbors.@propertydecorator and renames toget_available_segment_count(self, *, session: Session) -> int.session.scalar(...)instead ofdb.session.scalar(...).session=db_session_with_containers.This is a narrowly scoped, non-overlapping slice.
available_segment_counthas exactly two references in the repository: its definition and the integration test. No other open PR touches this symbol. The neighboring refactor PR #41647 explicitly leaves this symbol out of scope.Scope and compatibility
Verification
available_segment_count.From Claude Code
🤖 Generated with Claude Code