dara-core 1.19.0__py3-none-any.whl → 1.20.0__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.
Files changed (52) hide show
  1. dara/core/__init__.py +1 -0
  2. dara/core/auth/basic.py +13 -7
  3. dara/core/auth/definitions.py +2 -2
  4. dara/core/auth/utils.py +1 -1
  5. dara/core/base_definitions.py +7 -42
  6. dara/core/data_utils.py +16 -17
  7. dara/core/definitions.py +8 -8
  8. dara/core/interactivity/__init__.py +6 -0
  9. dara/core/interactivity/actions.py +26 -22
  10. dara/core/interactivity/any_data_variable.py +7 -135
  11. dara/core/interactivity/any_variable.py +1 -1
  12. dara/core/interactivity/client_variable.py +71 -0
  13. dara/core/interactivity/data_variable.py +8 -266
  14. dara/core/interactivity/derived_data_variable.py +6 -290
  15. dara/core/interactivity/derived_variable.py +381 -201
  16. dara/core/interactivity/filtering.py +29 -2
  17. dara/core/interactivity/loop_variable.py +2 -2
  18. dara/core/interactivity/non_data_variable.py +5 -68
  19. dara/core/interactivity/plain_variable.py +87 -14
  20. dara/core/interactivity/server_variable.py +325 -0
  21. dara/core/interactivity/state_variable.py +69 -0
  22. dara/core/interactivity/switch_variable.py +15 -15
  23. dara/core/interactivity/tabular_variable.py +94 -0
  24. dara/core/interactivity/url_variable.py +10 -90
  25. dara/core/internal/cache_store/cache_store.py +5 -20
  26. dara/core/internal/dependency_resolution.py +27 -69
  27. dara/core/internal/devtools.py +10 -3
  28. dara/core/internal/execute_action.py +9 -3
  29. dara/core/internal/multi_resource_lock.py +70 -0
  30. dara/core/internal/normalization.py +0 -5
  31. dara/core/internal/pandas_utils.py +105 -3
  32. dara/core/internal/pool/definitions.py +1 -1
  33. dara/core/internal/pool/task_pool.py +9 -6
  34. dara/core/internal/pool/utils.py +19 -14
  35. dara/core/internal/registries.py +3 -2
  36. dara/core/internal/registry.py +1 -1
  37. dara/core/internal/registry_lookup.py +5 -3
  38. dara/core/internal/routing.py +52 -121
  39. dara/core/internal/store.py +2 -29
  40. dara/core/internal/tasks.py +372 -182
  41. dara/core/internal/utils.py +25 -3
  42. dara/core/internal/websocket.py +1 -1
  43. dara/core/js_tooling/js_utils.py +2 -0
  44. dara/core/logging.py +10 -6
  45. dara/core/persistence.py +26 -4
  46. dara/core/umd/dara.core.umd.js +1091 -1469
  47. dara/core/visual/dynamic_component.py +17 -13
  48. {dara_core-1.19.0.dist-info → dara_core-1.20.0.dist-info}/METADATA +11 -11
  49. {dara_core-1.19.0.dist-info → dara_core-1.20.0.dist-info}/RECORD +52 -47
  50. {dara_core-1.19.0.dist-info → dara_core-1.20.0.dist-info}/LICENSE +0 -0
  51. {dara_core-1.19.0.dist-info → dara_core-1.20.0.dist-info}/WHEEL +0 -0
  52. {dara_core-1.19.0.dist-info → dara_core-1.20.0.dist-info}/entry_points.txt +0 -0
@@ -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, PendingValue
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], (PendingValue, PendingTask)):
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]: