atoti.Cube.shared_context#

property Cube.shared_context: MutableMapping[str, str]#

Context values shared by all the users.

Context values can also be set at query time, and per user, directly from the UI. The values in the shared context are the default ones for all the users.

  • queriesTimeLimit

    The number of seconds after which a running query is cancelled and its resources reclaimed. Set to -1 to remove the limit. Defaults to 30 seconds.

  • queriesResultLimit.intermediateLimit

    The limit number of point locations for a single intermediate result. This works as a safe-guard to prevent queries from consuming too much memory, which is especially useful when going to production with several simultaneous users on the same server. Set to -1 to remove the limit.

    Defaults to 1_000_000 if ATOTI_LICENSE is set, and to no limit otherwise.

  • queriesResultLimit.transientLimit

    Similar to intermediateLimit but across all the intermediate results of the same query. Set to -1 to remove the limit.

    Defaults to 10_000_000 if ATOTI_LICENSE is set, and to no limit otherwise.

Example

>>> df = pd.DataFrame(
...     columns=["City", "Price"],
...     data=[
...         ("London", 240.0),
...         ("New York", 270.0),
...         ("Paris", 200.0),
...     ],
... )
>>> table = session.read_pandas(
...     df, keys=["City"], table_name="shared_context example"
... )
>>> cube = session.create_cube(table)
>>> cube.shared_context["queriesTimeLimit"] = 60
>>> cube.shared_context["queriesResultLimit.intermediateLimit"] = 1000000
>>> cube.shared_context["queriesResultLimit.transientLimit"] = 10000000
>>> cube.shared_context
{'queriesTimeLimit': '60', 'queriesResultLimit.transientLimit': '10000000', 'queriesResultLimit.intermediateLimit': '1000000'}