-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refact!: discovery module + revised overview endpoints #496
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #496 +/- ##
===========================================
+ Coverage 87.70% 88.08% +0.37%
===========================================
Files 116 127 +11
Lines 4467 4566 +99
Branches 672 671 -1
===========================================
+ Hits 3918 4022 +104
+ Misses 393 390 -3
+ Partials 156 154 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass, nice asyncio usage for summaries
still working on tests for this, although project coverage may be lower now due to testing of branching. |
return stats | ||
|
||
|
||
async def get_field_options(field_props: DiscoveryFieldProps, low_counts_censored: bool) -> list[Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: make low_counts_censored
default to True
as a safeguard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good... I was thrown off at first by the new nesting experiment.data_type_specific.experiments
but it seems to make sense. Two issues / questions:
-
katsu has an endpoint
api/search_overview
that is used both by beacon and by bento_web: it takes a list of individual ids as input, and returns (uncensored) overview statistics for them. The format is the same as the old front page overview with some outer nesting removed. Now overview and search_overview are out of sync. They don't particularly need to be in sync, but it seems inelegant somehow if they're not. In the long term I wonder about the usefulness of a hardcoded overview fomat as opposed to the configurable public one. -
Is public overview always censored with count_threshold, or are there permissions that can remove the threshold?
regarding point 2, permissions haven't been done yet but will be done in the future |
One oddity about overview censorship (including current master) is it will wipe out entire categories if they are empty. This is fine for pie charts but not necessarily ideal for bar charts (where you may want to show categories with value zero.... think of the age distribution chart that becomes confusing if you remove bars from the middle of the chart if they happen to be empty) ... I guess the same point can apply to sparsely populated categories even when uncensored. |
Yeah that's not ideal handling - although if it's in master I won't bother with it here for now |
BREAKING CHANGE: new formats for various overview endpoints in order to share more code.
beacon: bento-platform/bento_beacon#79
web: bento-platform/bento_web#392