dara-core 1.19.0__py3-none-any.whl → 1.20.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dara/core/__init__.py +1 -0
- dara/core/auth/basic.py +13 -7
- dara/core/auth/definitions.py +2 -2
- dara/core/auth/utils.py +1 -1
- dara/core/base_definitions.py +7 -42
- dara/core/data_utils.py +16 -17
- dara/core/definitions.py +8 -8
- dara/core/interactivity/__init__.py +6 -0
- dara/core/interactivity/actions.py +26 -22
- dara/core/interactivity/any_data_variable.py +7 -135
- dara/core/interactivity/any_variable.py +1 -1
- dara/core/interactivity/client_variable.py +71 -0
- dara/core/interactivity/data_variable.py +8 -266
- dara/core/interactivity/derived_data_variable.py +6 -290
- dara/core/interactivity/derived_variable.py +379 -199
- dara/core/interactivity/filtering.py +29 -2
- dara/core/interactivity/loop_variable.py +2 -2
- dara/core/interactivity/non_data_variable.py +5 -68
- dara/core/interactivity/plain_variable.py +87 -14
- dara/core/interactivity/server_variable.py +325 -0
- dara/core/interactivity/state_variable.py +69 -0
- dara/core/interactivity/switch_variable.py +15 -15
- dara/core/interactivity/tabular_variable.py +94 -0
- dara/core/interactivity/url_variable.py +10 -90
- dara/core/internal/cache_store/cache_store.py +5 -20
- dara/core/internal/dependency_resolution.py +27 -69
- dara/core/internal/devtools.py +10 -3
- dara/core/internal/execute_action.py +9 -3
- dara/core/internal/multi_resource_lock.py +70 -0
- dara/core/internal/normalization.py +0 -5
- dara/core/internal/pandas_utils.py +105 -3
- dara/core/internal/pool/definitions.py +1 -1
- dara/core/internal/pool/task_pool.py +9 -6
- dara/core/internal/pool/utils.py +19 -14
- dara/core/internal/registries.py +3 -2
- dara/core/internal/registry.py +1 -1
- dara/core/internal/registry_lookup.py +5 -3
- dara/core/internal/routing.py +52 -121
- dara/core/internal/store.py +2 -29
- dara/core/internal/tasks.py +372 -182
- dara/core/internal/utils.py +25 -3
- dara/core/internal/websocket.py +1 -1
- dara/core/js_tooling/js_utils.py +2 -0
- dara/core/logging.py +10 -6
- dara/core/persistence.py +26 -4
- dara/core/umd/dara.core.umd.js +1082 -1464
- dara/core/visual/dynamic_component.py +17 -13
- {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/METADATA +11 -11
- {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/RECORD +52 -47
- {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/LICENSE +0 -0
- {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/WHEEL +0 -0
- {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/entry_points.txt +0 -0
dara/core/internal/store.py
CHANGED
|
@@ -17,7 +17,7 @@ limitations under the License.
|
|
|
17
17
|
|
|
18
18
|
from typing import Any, Dict, List, Optional
|
|
19
19
|
|
|
20
|
-
from dara.core.base_definitions import CacheType, PendingTask
|
|
20
|
+
from dara.core.base_definitions import CacheType, PendingTask
|
|
21
21
|
from dara.core.internal.utils import get_cache_scope
|
|
22
22
|
|
|
23
23
|
|
|
@@ -59,8 +59,6 @@ class Store:
|
|
|
59
59
|
cache_key = get_cache_scope(cache_type)
|
|
60
60
|
value = self._store.get(cache_key, {}).get(key)
|
|
61
61
|
|
|
62
|
-
if isinstance(value, PendingValue):
|
|
63
|
-
return await value.wait()
|
|
64
62
|
if isinstance(value, PendingTask):
|
|
65
63
|
return await value.run()
|
|
66
64
|
return value
|
|
@@ -86,33 +84,8 @@ class Store:
|
|
|
86
84
|
if self._store.get(cache_key) is None:
|
|
87
85
|
self._store[cache_key] = {}
|
|
88
86
|
|
|
89
|
-
# If there is a PendingValue set for this key then trigger its resolution
|
|
90
|
-
if isinstance(self._store[cache_key].get(key), PendingValue):
|
|
91
|
-
if error is not None:
|
|
92
|
-
self._store[cache_key][key].error(error)
|
|
93
|
-
else:
|
|
94
|
-
self._store[cache_key][key].resolve(value)
|
|
95
|
-
|
|
96
87
|
self._store[cache_key][key] = value
|
|
97
88
|
|
|
98
|
-
def set_pending_value(self, key: str, cache_type: Optional[CacheType] = CacheType.GLOBAL):
|
|
99
|
-
"""
|
|
100
|
-
Set a pending state for a value in the store. This will trigger the async behavior of the get call if subsequent
|
|
101
|
-
requests ask for the same key. A future is created in the store, which all requests then listen for the
|
|
102
|
-
resolution of before returning.
|
|
103
|
-
|
|
104
|
-
:param key: the key to set as pending
|
|
105
|
-
:param cache_type: whether to pull the value from the specified cache specific store or the global one, defaults to
|
|
106
|
-
the global one
|
|
107
|
-
"""
|
|
108
|
-
cache_key = get_cache_scope(cache_type)
|
|
109
|
-
if self._store.get(cache_key) is None:
|
|
110
|
-
self._store[cache_key] = {}
|
|
111
|
-
|
|
112
|
-
pending_val = PendingValue()
|
|
113
|
-
|
|
114
|
-
self._store[cache_key][key] = pending_val
|
|
115
|
-
|
|
116
89
|
def set_pending_task(self, key: str, pending_task: PendingTask, cache_type: Optional[CacheType] = CacheType.GLOBAL):
|
|
117
90
|
"""
|
|
118
91
|
Store a pending task state for a given key in the store. This will trigger the async behavior of the get call if subsequent
|
|
@@ -158,7 +131,7 @@ class Store:
|
|
|
158
131
|
# Otherwise go through and remove any non-pending values
|
|
159
132
|
keys = list(cache_type_store.keys())
|
|
160
133
|
for key in keys:
|
|
161
|
-
if not isinstance(cache_type_store[key],
|
|
134
|
+
if not isinstance(cache_type_store[key], PendingTask):
|
|
162
135
|
cache_type_store.pop(key)
|
|
163
136
|
|
|
164
137
|
def list(self, cache_type: Optional[CacheType] = CacheType.GLOBAL) -> List[str]:
|