-
Notifications
You must be signed in to change notification settings - Fork 292
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
refactor(sessions): add dataloaders for session queries #5222
Conversation
src/phoenix/server/api/dataloaders/session_first_input_last_outputs.py
Outdated
Show resolved
Hide resolved
src/phoenix/server/api/context.py
Outdated
@@ -68,6 +71,10 @@ class DataLoaders: | |||
latency_ms_quantile: LatencyMsQuantileDataLoader | |||
min_start_or_max_end_times: MinStartOrMaxEndTimeDataLoader | |||
record_counts: RecordCountDataLoader | |||
session_first_inputs: SessionFirstInputLastOutputsDataLoader |
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.
session_first_inputs: SessionFirstInputLastOutputsDataLoader | |
session_inputs: SessionIODataLoader |
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.
I think this can be ambiguous, since it can imply a list of inputs per session, whereas first_input matches the graphql field, which is more explicit
stmt = ( | ||
select(models.Trace.project_session_rowid.label("id_")) | ||
.join_from(models.Span, models.Trace) | ||
.where(models.Span.parent_id.is_(None)) | ||
.where(models.Trace.project_session_rowid.isnot(None)) | ||
) |
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.
Do we need to handle the case of multiple root spans in a single trace?
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.
we're punting on that for now, since there' no good way to display them
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.
How does the query plan look with the row number/ filter on rank approach?
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.
models.Span.attributes[INPUT_VALUE].label("value"), | ||
models.Span.attributes[INPUT_MIME_TYPE].label("mime_type"), |
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.
Same non-blocking comment as before.
No description provided.