Skip to content

trulens.dashboard.utils.dashboard_utils

trulens.dashboard.utils.dashboard_utils

Functions

read_query_params_into_session_state

read_query_params_into_session_state(
    page_name: str,
    transforms: Optional[
        Dict[str, Callable[[str], Any]]
    ] = None,
)

This method loads query params into the session state. This function should only be called only once when the page is first initialized.

PARAMETER DESCRIPTION
page_name

Name of the page being initialized. Used to prefix page-specific session keys.

TYPE: str

transforms

An optional dictionary mapping query param names to a function that deserializes the respective query arg value. Defaults to None.

TYPE: Optional[dict[str, Callable]] DEFAULT: None

is_sis_compatibility_enabled

is_sis_compatibility_enabled()

This method returns whether the SIS compatibility feature is enabled. The SiS compatibility feature adapts dashboard components to support Streamlit in Snowflake (SiS). As of 11/13/2024, SiS runs on Python 3.8, Streamlit 1.35.0, and does not support bidirectional custom components.

In the TruLens dashboard, this flag will replace or disable certain custom components (like Aggrid and the trace viewer).

RETURNS DESCRIPTION
bool

True if the SIS compatibility feature is enabled, False otherwise.

get_session

get_session() -> TruSession

Parse command line arguments and initialize TruSession with them.

As TruSession is a singleton, further TruSession() uses will get the same configuration.