Skip to content

state_stores

mlte/backend/core/state_stores.py

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
17
18
19
20
21
22
23
24
25
26
27
@contextmanager
def artifact_store_session() -> Generator[ArtifactStoreSession, None, None]:
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: ArtifactStoreSession = state.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
43
44
45
46
47
48
49
50
51
52
53
@contextmanager
def catalog_stores_session() -> Generator[CatalogStoreGroupSession, None, None]:
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: CatalogStoreGroupSession = state.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
56
57
58
59
60
61
62
63
64
65
66
67
68
@contextmanager
def custom_list_stores_session() -> (
    Generator[CustomListStoreSession, None, None]
):
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: CustomListStoreSession = state.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
30
31
32
33
34
35
36
37
38
39
40
@contextmanager
def user_store_session() -> Generator[UserStoreSession, None, None]:
    """
    Get a handle to underlying store session.
    :return: The session handle
    """
    session: UserStoreSession = state.user_store.session()
    try:
        yield session
    finally:
        session.close()