-
Notifications
You must be signed in to change notification settings - Fork 433
fix: Fix span sort #7425
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
base: feat/annotations
Are you sure you want to change the base?
fix: Fix span sort #7425
Conversation
* Drop unique constraint migration * Update /span_annotations REST route * Update bulk inserters * Update data loader to aggregate label fractions per span first * Use correct kwarg name * Use sqlite compatible migration * Always use batch_alter_table * Ensure that spans with an annotation aggregate labels properly * Use auto recreate * Re-apply SpanFilter * Add migration to integration test * Update OpenAPI schema * Update traces router * Update helper test * Cast to floats before doing arithmetic * Add type annotations * Rebuild js client * Use more robust typing * Use a weighted avg for scores - optimize query to not use cartesian product - will scale very poorly as the number of labels increases * Use properly per-span aggregated scores * Cast to float before returning LabelFraction * Add tests * Remove score column from base stmt * Use column indexing * Improve clarity for type checker * Fix unit test type checks
Co-authored-by: Alexander Song <axiomofjoy@gmail.com>
* feat(annotations): Annotation Config UI * Fix style merging in AnnotationLabel * Handle large values * Rename card * Persist annotation config via gql * Convert annotation config popover to dialog * Implement annotation selection toolbar + deletion * Remove bad lint rule * Replace dialog extra buttons with cancel button * styling changes * clean up annotation label * Remove hover state from annotation label unless clickable
Co-authored-by: Mikyo King <mikyo@arize.com>
* temporary * feat(annotations): add a ui to add / remove project annotations
* feat(annotations): addd notes UI to the side-bar * cleanup * add date * add ci * add changes
Additionally: * Add react-aria package and FocusScope * Use dark mode in storybook if OS is set to dark mode
chore: codegen on ts client fix(annotations): fix facilitator chore: fix text chore: openapi and mypy fixes chore: ruff codegen
* feat(annotations): full annotations table * feat(annotations): full annotation table in the feedback tab
* feat(admin): display retention policies * memo
* rudimentary dialogue * create the basic layout * add validation * Add forced refetch * switch to paginated for now * add mode
* feat(admin): project retention policies * WIP * final * final * cleanup * cleanup * cleanup * cleanup
* Create annotation configs feature branch * Add upsert logic to span annotation insertion * Change trace annotation mutation as well * Use SupportedSQLDialect enum * Use default constraint names * Use `create_index` for the partial constraint * Implement backwards-compatible identifier index * Add CODE to allowed annotator kind * Start reorganizing migration to primarily use batch ops * Reorganize downgrade to use batch ops * Fix drop constraint call args * Update constraint name * Improve SpanAnnotation upsert logic * Update trace annotation mutations * Update REST route as well * Fix constraint name in migration * Refactor migrations * Fix rest route * Update test fixtures * Add backwards compatible constraint to document annotations * Add tests * Add backwards compatibility test * Remove needless fixture * Ignore type issues on the return types * Restructure mutation * dedent * decode ids outside transaction * decode trace rowids outside session --------- Co-authored-by: Alexander Song <axiomofjoy@gmail.com>
* Add `get_span_annotations_dataframe` * Fix route and use `context.span_id` to match on span id * Update client method names * Address feedback * Fix line lengths * Add get_span_annotations method * Clarify types * Continue clarifying types * Continue clarifying types * Continue fixing types * Use more precise type annotations * Remove type: ignores
* feat: Stabilize categorical annotation summary pie chart colors * Keep more queries around in the relay gc buffer before emptying * Update project-level annotation summary when annotation is edited
…eover (#7418) * fix: Prevent time range context error when opening trace details slideover * Remove extraneous type cast
…er and other new columns (#7421)
if sort_value is not None: | ||
cursor.sort_column = CursorSortColumn( |
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.
Could you please help me understand how this approach would fetch the next page correctly, i.e. if the sort column is not transmitted, how would the next fetch know which column to sort on in order to arrive at the correct page? In the special case where first == 1
, wouldn't the pagination stop working as soon as it encounters a None
value?
|
||
def _none_last_key(annotation: models.SpanAnnotation) -> Any: | ||
value = getattr(annotation, sort_key) | ||
# Return a tuple so that None values are always considered greater (i.e., sorted last) | ||
return (value is None, value) | ||
|
||
annotations.sort(key=_none_last_key) | ||
if sort_descending: | ||
# Reverse only the non-None portion to keep None values at the end | ||
non_none_annotations = [a for a in annotations if getattr(a, sort_key) is not None] | ||
none_annotations = [a for a in annotations if getattr(a, sort_key) is None] | ||
non_none_annotations.reverse() | ||
annotations = non_none_annotations + none_annotations |
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.
Could you please help me understand how sorting annotations differently is necessary to address the span-sorting issue?
* feat: style keyboard tokens to look more like keys * styling
* Add empty state to span annotation editor * Set default categorical annotation config length to 2 * Refetch annotation configs when updated * Fix settings page crash due to viewer object being unloaded * Display falsy mean scores in tables * Improve labels for negative continuous ranges * Add placeholder for continuous inputs * Rename feedback and annotation tabs * Display errors when updating annotations/explanations fails * Tweak explain label size and positions * Add trace link copy button to trace details * Exclude annotation explain button from focus manager * Update ShareLinkButton Icon and positioning
…sted under a data key (#7443)
* feat: add group * add group story
74a51d5
to
cc87361
Compare
are we punting on this? If so we should move back to draft |
0750554
to
beb1c9c
Compare
resolves #7416