-
Notifications
You must be signed in to change notification settings - Fork 197
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
span database #1608
base: main
Are you sure you want to change the base?
span database #1608
Conversation
class DB(serial_utils.SerialModel, abc.ABC, text_utils.WithIdentString): | ||
"""Abstract definition of databases used by trulens. | ||
|
||
[SQLAlchemyDB][trulens.core.database.sqlalchemy.SQLAlchemyDB] is the main | ||
and default implementation of this interface. | ||
""" | ||
|
||
T: ClassVar[Type] = 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.
Consider using more specific types instead of Type
for T
, Q
, and W
to improve type safety and clarity. This comment applies to lines 106, 109, and 112.
T: ClassVar[Type] = Any | |
T: ClassVar[SpecificType] = Any |
before_created_timestamp: builtins.NoneType | ||
before_index: builtins.NoneType | ||
before_updated_timestamp: builtins.NoneType | ||
limit: builtins.NoneType |
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.
Consider initializing limit
and offset
with integer values instead of NoneType
to avoid potential issues in calculations or queries.
limit: builtins.NoneType | |
limit: builtins.int |
Description
Adds
trulens-semconv
package to hold tracing attribute names and related. This package intentionally has no dependencies other than otel semconv packages.Adds span schema as orm classes and span to/of orm methods.
Adds span "semantic categories" for known components like retrievers.
Adds span extensions to db base abstract class and the sqlalchemy implementation for inserting, selecting, deleting spans.
Adds some prototype abstractions to base DB class for pagination and queries.
Extended
trulens.core.schema.types
with classes organizing types for values we use across python, otel, and sql.- Recognizing spans into the semantic categories not included (but the categories exist). Will bring this in from an old PR next.
- Feedback evaluation not included.
- Collector not included (though started in this PR).
Other details good to know for developers
Please include any other details of this change useful for TruLens developers.
Type of change
not work as expected)
Important
Introduces
trulens-semconv
for tracing attributes, adds span schema and database methods, and organizes types across Python, OTEL, and SQL.trulens-semconv
package for tracing attribute names.SpanAttributes
andSpanType
intrace.py
for span categorization.trulens.core.schema.types
for organizing types across Python, OTEL, and SQL.pyproject.toml
to includetrulens-semconv
package.This description was created by for 812dfc2. It will automatically update as commits are pushed.