Skip to content

state_stores

Managed store sessions obtained from the global state context.

artifact_store_session()

Get a handle to underlying store session.

Returns:

Type Description
Generator[ArtifactStoreSession, None, None]

The session handle

Source code in mlte/backend/core/state_stores.py
13
14
15
16
17
18
19
20
21
22
23
@contextmanager
def artifact_store_session() -> Generator[ArtifactStoreSession, None, None]:
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: ArtifactStoreSession = state.stores.artifact_store.session()
    try:
        yield session
    finally:
        session.close()

catalog_stores_session()

Get a handle to underlying store session.

Returns:

Type Description
Generator[CatalogStoreGroupSession, None, None]

The session handle

Source code in mlte/backend/core/state_stores.py
39
40
41
42
43
44
45
46
47
48
49
@contextmanager
def catalog_stores_session() -> Generator[CatalogStoreGroupSession, None, None]:
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: CatalogStoreGroupSession = state.stores.catalog_stores.session()
    try:
        yield session
    finally:
        session.close()

custom_list_stores_session()

Get a handle to underlying store session.

Returns:

Type Description
Generator[CustomListStoreSession, None, None]

The session handle

Source code in mlte/backend/core/state_stores.py
52
53
54
55
56
57
58
59
60
61
62
63
64
@contextmanager
def custom_list_stores_session() -> (
    Generator[CustomListStoreSession, None, None]
):
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: CustomListStoreSession = state.stores.custom_list_store.session()
    try:
        yield session
    finally:
        session.close()

user_store_session()

Get a handle to underlying store session.

Returns:

Type Description
Generator[UserStoreSession, None, None]

The session handle

Source code in mlte/backend/core/state_stores.py
26
27
28
29
30
31
32
33
34
35
36
@contextmanager
def user_store_session() -> Generator[UserStoreSession, None, None]:
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: UserStoreSession = state.stores.user_store.session()
    try:
        yield session
    finally:
        session.close()