Repository navigation
fix(overview_metrics): opt-in strict counts (ISSUE-123) - #448
Merged
Merged
Conversation
…ured (ISSUE-123) count_elements, count_elements_by_property, counts_by_type, people_counts and usage_context_counts take strict=False by default (unchanged: a failed query counts as 0). With strict=True they return None when the fallback query failed or answered unexpectedly, or when it hit DEFAULT_CAP (a lower bound). A native count and a real zero are still numbers. strict is declared on the five analytic-registry entries so report specs can pass it. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.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.
Summary
count_elementsand its siblings turn a failed query into0, so an outage or auth failure looks like an empty catalog (ISSUE-123). This adds an opt-instrictflag and leaves the default alone.strict=False(default): unchanged, a failure counts as0.strict=True: returnsNonewhen the count is not known:find_metadata_elementsquery raised;DEFAULT_CAP), which is only a lower bound.0.Nonelogs a warning that says why.count_elements,count_elements_by_property,counts_by_type,people_countsandusage_context_counts.strictis declared on those five analytic-registry entries, so a report spec can pass it.PYEGERIA_ISSUES.md: ISSUE-123 is moved to Fixed.Closes #424
Test plan
tests/micro-tests/test_issue_123_strict_counts.pypytest tests/micro-tests: 1085 passed, 1 skipped🤖 Generated with Claude Code