-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat: plumb Dataset start/end times through graphQL #194
Conversation
src/phoenix/core/model.py
Outdated
from phoenix.datasets import Dataset | ||
from phoenix.datasets.schema import EmbeddingFeatures | ||
from phoenix.core.datasets import Dataset | ||
from phoenix.core.datasets.schema import EmbeddingFeatures |
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 I sorta wanted the code that the user interacts with be unnested and not be part of core. Core being part of the application. I think voxel has a similar organization. Makes for easier discovery in the notebook. But we would dissuade people from importing core in the notebook
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.
Ah ok gotcha -- so datasets is the API interface so to speak, and users should never need to interact with anything in core.
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.
Yeah that was the idea. That the user interacts with datasets and metrics, phoenix serves core via an api.
app/schema.graphql
Outdated
startTime: DateTime | ||
endTime: DateTime |
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.
startTime: DateTime | |
endTime: DateTime | |
startTime: DateTime! | |
endTime: DateTime! |
Let's make these non-maybe
readonly endTime: any | null; | ||
readonly name: string; | ||
readonly startTime: any | null; |
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.
update relay.config and these will become strings.
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.
err, what do I update relay.config with? do I need to add something?
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.
oh nm, got it.
app/relay.config.js
Outdated
@@ -7,5 +7,6 @@ module.exports = { | |||
noFutureProofEnums: true, | |||
customScalars: { | |||
GlobalID: "String", | |||
"DateTime": "string", |
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.
It's mapping to another base primitive so it should be uppercase String
src/phoenix/datasets/dataset.py
Outdated
def start_time(self) -> datetime: | ||
"""Returns the datetime of the earliest inference in the dataset""" | ||
ts_col_name: str = cast(str, self.schema.timestamp_column_name) | ||
dt: datetime = self.__dataframe[ts_col_name].min() |
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.
Since this never changes you can use dynamic programming to compute once
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'm assuming you're referring to the caching aspect of dp? how about just using the @cached_property annotation? or do we have a preexisting convention for how we'd like to do this?
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.
Oh that's great. Very cool
src/phoenix/datasets/dataset.py
Outdated
@property | ||
def end_time(self) -> datetime: | ||
"""Returns the datetime of the latest inference in the dataset""" | ||
ts_col_name: str = cast(str, self.schema.timestamp_column_name) |
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.
Prefer dynamic programming to compute once
src/phoenix/datasets/dataset.py
Outdated
"""Returns the datetime of the latest inference in the dataset""" | ||
ts_col_name: str = cast(str, self.schema.timestamp_column_name) | ||
dt: datetime = self.__dataframe[ts_col_name].max() | ||
return dt |
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.
Been advocating for non abbreviated variable names right now https://youtu.be/-J3wNP6u5YU
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.
👍 -- done
Resolves #172