Skip to content

trulens.connectors.snowflake.snowflake_event_table_db

trulens.connectors.snowflake.snowflake_event_table_db

Classes

SnowflakeEventTableDB

Bases: DB

Connector to the account level event table in Snowflake.

Attributes
redact_keys class-attribute instance-attribute

Redact secrets before writing out data.

Functions
get_records_and_feedback
get_records_and_feedback(
    app_ids: Optional[List[AppID]] = None,
    app_name: Optional[AppName] = None,
    app_version: Optional[AppVersion] = None,
    app_versions: Optional[List[AppVersion]] = None,
    record_ids: Optional[List[RecordID]] = None,
    offset: Optional[int] = None,
    limit: Optional[int] = None,
) -> Tuple[DataFrame, Sequence[str]]

Get records from the database.

PARAMETER DESCRIPTION
app_ids

If given, retrieve only the records for the given apps. Otherwise all apps are retrieved.

TYPE: Optional[List[AppID]] DEFAULT: None

app_name

If given, retrieve only the records for the given app name.

TYPE: Optional[AppName] DEFAULT: None

app_version

If given, retrieve only the records for the given app version.

TYPE: Optional[AppVersion] DEFAULT: None

app_versions

If given, retrieve only the records for the given app versions.

TYPE: Optional[List[AppVersion]] DEFAULT: None

record_ids

Optional list of record IDs to filter by. Defaults to None.

TYPE: Optional[List[RecordID]] DEFAULT: None

offset

Database row offset.

TYPE: Optional[int] DEFAULT: None

limit

Limit on rows (records) returned.

TYPE: Optional[int] DEFAULT: None

RETURNS DESCRIPTION
DataFrame

A DataFrame with the records.

Sequence[str]

A list of column names that contain feedback results.

get_events
get_events(
    app_name: Optional[AppName] = None,
    app_version: Optional[AppVersion] = None,
    record_ids: Optional[List[RecordID]] = None,
    start_time: Optional[datetime] = None,
) -> DataFrame

Get events from the database.

PARAMETER DESCRIPTION
app_name

The app name to filter events by.

TYPE: Optional[AppName] DEFAULT: None

app_version

The app version to filter events by.

TYPE: Optional[AppVersion] DEFAULT: None

record_ids

The record ids to filter events by.

TYPE: Optional[List[RecordID]] DEFAULT: None

start_time

The minimum time to consider events from.

TYPE: Optional[datetime] DEFAULT: None

RETURNS DESCRIPTION
DataFrame

A pandas DataFrame of all relevant events.

get_apps
get_apps(
    app_name: Optional[AppName] = None,
) -> Iterable[JSONized[AppDefinition]]
__rich_repr__
__rich_repr__() -> Result

Requirement for pretty printing using the rich package.

update_app_metadata
update_app_metadata(
    app_id: AppID, metadata: Dict[str, Any]
) -> Optional[AppDefinition]

Update the metadata of an app.

extract_app_and_run_info staticmethod
extract_app_and_run_info(
    attributes: Dict[str, Any],
    resource_attributes: Dict[str, Any],
) -> Tuple[str, str, str, str]

Get app info from attributes.

PARAMETER DESCRIPTION
attributes

Span attributes of record root.

TYPE: Dict[str, Any]

resource_attributes

Resource attributes of record root.

TYPE: Dict[str, Any]

RETURNS DESCRIPTION
Tuple[str, str, str, str]

Tuple of: app name, app version, app id, and run name.