dara-core 1.12.7__py3-none-any.whl → 1.13.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.
@@ -175,19 +175,7 @@ class DerivedDataVariable(AnyDataVariable, DerivedVariable):
175
175
  filtered_data, count = apply_filters(data, coerce_to_filter_query(filters), pagination)
176
176
 
177
177
  # Cache the count
178
- await asyncio.gather(
179
- store.set(var_entry, key=count_cache_key, value=count, pin=True),
180
- store.set(
181
- registry_entry=var_entry,
182
- key=DerivedDataVariable._get_schema_cache_key(
183
- count_cache_key.split('_')[0] # remove the filter part from the key
184
- ),
185
- value=build_table_schema(df_convert_to_internal(cast(DataFrame, filtered_data)))
186
- if isinstance(filtered_data, DataFrame)
187
- else None,
188
- pin=True,
189
- ),
190
- )
178
+ await store.set(var_entry, key=count_cache_key, value=count, pin=True)
191
179
 
192
180
  return filtered_data
193
181
 
@@ -329,11 +317,13 @@ class DerivedDataVariable(AnyDataVariable, DerivedVariable):
329
317
  return entry
330
318
 
331
319
  @classmethod
332
- async def get_schema(cls, data_entry: DataVariableRegistryEntry, store: CacheStore, cache_key: str):
320
+ async def get_schema(cls, derived_entry: DerivedVariableRegistryEntry, store: CacheStore, cache_key: str):
333
321
  """
334
322
  Get the schema of the derived data variable.
335
323
  """
336
- return cast(DataFrameSchema, await store.get(data_entry, key=cls._get_schema_cache_key(cache_key), unpin=True))
324
+ return cast(
325
+ DataFrameSchema, await store.get(derived_entry, key=cls._get_schema_cache_key(cache_key), unpin=True)
326
+ )
337
327
 
338
328
  @classmethod
339
329
  async def resolve_value(
@@ -391,17 +391,19 @@ def create_router(config: Configuration):
391
391
  try:
392
392
  store: CacheStore = utils_registry.get('Store')
393
393
  registry_mgr: RegistryLookup = utils_registry.get('RegistryLookup')
394
- variable_def = await registry_mgr.get(data_variable_registry, uid)
394
+ data_def = await registry_mgr.get(data_variable_registry, uid)
395
395
 
396
- if variable_def.type == 'plain':
397
- return await variable_def.get_schema(variable_def, store)
396
+ if data_def.type == 'plain':
397
+ return await data_def.get_schema(data_def, store)
398
398
 
399
399
  if cache_key is None:
400
400
  raise HTTPException(
401
401
  status_code=400, detail='Cache key is required when requesting DerivedDataVariable schema'
402
402
  )
403
403
 
404
- data = await variable_def.get_schema(variable_def, store, cache_key)
404
+ # Use the other registry for derived variables
405
+ derived_ref = await registry_mgr.get(derived_variable_registry, uid)
406
+ data = await data_def.get_schema(derived_ref, store, cache_key)
405
407
  content = json.dumps(jsonable_encoder(data)) if isinstance(data, dict) else data
406
408
  return Response(content=content, media_type='application/json')
407
409
  except ValueError as e:
@@ -6,7 +6,7 @@ export default defineConfig({
6
6
  plugins: [
7
7
  react({
8
8
  jsxRuntime: 'classic',
9
- }),
9
+ })
10
10
  ],
11
11
  publicDir: false,
12
12
  build: {
@@ -25,4 +25,7 @@ export default defineConfig({
25
25
  strict: false,
26
26
  },
27
27
  },
28
+ worker: {
29
+ format: 'es',
30
+ }
28
31
  });
@@ -29753,9 +29753,9 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29753
29753
 
29754
29754
  figcaption {
29755
29755
  margin-top: 0.875rem;
29756
- color: ${(props) => props.theme.colors.grey5};
29757
29756
  font-size: 0.875rem;
29758
29757
  line-height: 1.5rem;
29758
+ color: ${(props) => props.theme.colors.grey5};
29759
29759
  }
29760
29760
 
29761
29761
  h2 code {
@@ -29855,14 +29855,16 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29855
29855
  }
29856
29856
 
29857
29857
  table {
29858
- font-size: 0.875rem;
29859
- line-height: 1.7;
29860
- margin-top: 2rem;
29861
- margin-bottom: 2rem;
29862
29858
  table-layout: auto;
29863
- width: 100%;
29864
29859
  border-collapse: collapse;
29865
29860
 
29861
+ width: 100%;
29862
+ margin-top: 2rem;
29863
+ margin-bottom: 2rem;
29864
+
29865
+ font-size: 0.875rem;
29866
+ line-height: 1.7;
29867
+
29866
29868
  thead {
29867
29869
  border-bottom: 1px solid ${(props) => props.theme.colors.grey3};
29868
29870
 
@@ -29870,9 +29872,10 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29870
29872
  padding-right: 0.5rem;
29871
29873
  padding-bottom: 0.5rem;
29872
29874
  padding-left: 0.5rem;
29873
- vertical-align: bottom;
29875
+
29874
29876
  font-weight: 600;
29875
29877
  text-align: start;
29878
+ vertical-align: bottom;
29876
29879
  }
29877
29880
 
29878
29881
  th:first-child {
@@ -29888,8 +29891,8 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29888
29891
  border-top: 1px solid ${(props) => props.theme.colors.grey2};
29889
29892
 
29890
29893
  td {
29891
- vertical-align: top;
29892
29894
  text-align: start;
29895
+ vertical-align: top;
29893
29896
  }
29894
29897
  }
29895
29898
 
@@ -29904,8 +29907,8 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29904
29907
 
29905
29908
  td {
29906
29909
  padding: 0.5rem;
29907
- vertical-align: baseline;
29908
29910
  text-align: start;
29911
+ vertical-align: baseline;
29909
29912
 
29910
29913
  &:first-child {
29911
29914
  padding-left: 0;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dara-core
3
- Version: 1.12.7
3
+ Version: 1.13.0
4
4
  Summary: Dara Framework Core
5
5
  Home-page: https://dara.causalens.com/
6
6
  License: Apache-2.0
@@ -20,10 +20,10 @@ Requires-Dist: async-asgi-testclient (>=1.4.11,<2.0.0)
20
20
  Requires-Dist: certifi (>=2024.7.4)
21
21
  Requires-Dist: click (==8.1.3)
22
22
  Requires-Dist: colorama (>=0.4.6,<0.5.0)
23
- Requires-Dist: create-dara-app (==1.12.7)
23
+ Requires-Dist: create-dara-app (==1.13.0)
24
24
  Requires-Dist: croniter (>=1.0.15,<2.0.0)
25
25
  Requires-Dist: cryptography (>=42.0.4)
26
- Requires-Dist: dara-components (==1.12.7) ; extra == "all"
26
+ Requires-Dist: dara-components (==1.13.0) ; extra == "all"
27
27
  Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0)
28
28
  Requires-Dist: fastapi (==0.109.0)
29
29
  Requires-Dist: fastapi-vite (==0.3.1)
@@ -51,7 +51,7 @@ Description-Content-Type: text/markdown
51
51
 
52
52
  # Dara Application Framework
53
53
 
54
- <img src="https://github.com/causalens/dara/blob/v1.12.7/img/dara_light.svg?raw=true">
54
+ <img src="https://github.com/causalens/dara/blob/v1.13.0/img/dara_light.svg?raw=true">
55
55
 
56
56
  ![Master tests](https://github.com/causalens/dara/actions/workflows/tests.yml/badge.svg?branch=master)
57
57
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
@@ -96,7 +96,7 @@ source .venv/bin/activate
96
96
  dara start
97
97
  ```
98
98
 
99
- ![Dara App](https://github.com/causalens/dara/blob/v1.12.7/img/components_gallery.png?raw=true)
99
+ ![Dara App](https://github.com/causalens/dara/blob/v1.13.0/img/components_gallery.png?raw=true)
100
100
 
101
101
  Note: `pip` installation uses [PEP 660](https://peps.python.org/pep-0660/) `pyproject.toml`-based editable installs which require `pip >= 21.3` and `setuptools >= 64.0.0`. You can upgrade both with:
102
102
 
@@ -113,9 +113,9 @@ Explore some of our favorite apps - a great way of getting started and getting t
113
113
 
114
114
  | Dara App | Description |
115
115
  | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
- | ![Large Language Model](https://github.com/causalens/dara/blob/v1.12.7/img/llm.png?raw=true) | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
117
- | ![Plot Interactivity](https://github.com/causalens/dara/blob/v1.12.7/img/plot_interactivity.png?raw=true) | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
118
- | ![Graph Editor](https://github.com/causalens/dara/blob/v1.12.7/img/graph_viewer.png?raw=true) | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
116
+ | ![Large Language Model](https://github.com/causalens/dara/blob/v1.13.0/img/llm.png?raw=true) | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
117
+ | ![Plot Interactivity](https://github.com/causalens/dara/blob/v1.13.0/img/plot_interactivity.png?raw=true) | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
118
+ | ![Graph Editor](https://github.com/causalens/dara/blob/v1.13.0/img/graph_viewer.png?raw=true) | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
119
119
 
120
120
  Check out our [App Gallery](https://dara.causalens.com/gallery) for more inspiration!
121
121
 
@@ -127,9 +127,9 @@ This repository covers the Dara Application Framework first-party packages.
127
127
  - `dara-components`: Components for the Dara Framework.
128
128
  - `create-dara-app`: A CLI tool for creating new Dara applications.
129
129
 
130
- More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.12.7/CONTRIBUTING.md) file.
130
+ More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.13.0/CONTRIBUTING.md) file.
131
131
 
132
132
  ## License
133
133
 
134
- Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.12.7/LICENSE).
134
+ Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.13.0/LICENSE).
135
135
 
@@ -20,7 +20,7 @@ dara/core/interactivity/any_data_variable.py,sha256=npgtgAIEKNix8VGYLFCc1G3jwXr1
20
20
  dara/core/interactivity/any_variable.py,sha256=HuQTcCw1ysqYcJ5T9Jl--nV_1XzDWMfGw26g6eaQM2k,13281
21
21
  dara/core/interactivity/condition.py,sha256=ynK53cGuVMC852X6kkbrgltcdpIX7Otw7j1DEXEO4Q8,1424
22
22
  dara/core/interactivity/data_variable.py,sha256=KIN2V2ipESfhczBtmyPnZUi0iirlZXdN1S1P0aPPVRA,11099
23
- dara/core/interactivity/derived_data_variable.py,sha256=Y3Yw5gdnjvVIUrZhyHafCEaQZMyVT9S5SJ7sC8lcYxA,15176
23
+ dara/core/interactivity/derived_data_variable.py,sha256=RsVotZuWUvF3Z08-8HT9SSkAeObIZ4pPxLee54g80lQ,14711
24
24
  dara/core/interactivity/derived_variable.py,sha256=6xOv-E5wQj-fd9S2RVmRdE_DfkvxVGyptfZlDSj0fmY,21497
25
25
  dara/core/interactivity/filtering.py,sha256=veQbDi4ogeDO5SODOp3hpx1FQGAYKFLwnhqmbfFDyJo,9168
26
26
  dara/core/interactivity/non_data_variable.py,sha256=ewPaNaTpMixR5YCVY1pjmyHgeC53K0CsjQxMusbJsiw,1147
@@ -54,7 +54,7 @@ dara/core/internal/port_utils.py,sha256=AQOUNiFNBYKVUwQ7i9UlY1NQ3sWb5xh5GkO6P1Bm
54
54
  dara/core/internal/registries.py,sha256=9WDczIsNeSmzi6aViIq_b14lmmYGGkdsUGHpv0Sg9zo,3278
55
55
  dara/core/internal/registry.py,sha256=ONCDusqaL0q59Py_r8-fFVN3vbkkDf5TXzNvbB9SrGQ,4305
56
56
  dara/core/internal/registry_lookup.py,sha256=8snHu2wUUsngXjHyHh6eZqL_WwonTTQB6-WBX-R_WZg,2238
57
- dara/core/internal/routing.py,sha256=mdFOz8Q7g0IWUAl-qR5cHzK9qXn8QbNHhTuKVrxTp7E,22530
57
+ dara/core/internal/routing.py,sha256=R2SLQ_d81wVG0qxBI9fH_6XrBKdvkf0QVUVf9lqD7Gg,22649
58
58
  dara/core/internal/scheduler.py,sha256=z6OYwazBf3GYo8CzMC9IuGC2P96gI7JwxquT8GaoTMk,12944
59
59
  dara/core/internal/settings.py,sha256=wAWxl-HXjq7PW3twe_CrR-UuMRw9VBudC3eRmevZAhM,3869
60
60
  dara/core/internal/store.py,sha256=qVyU7JfC3zE2vYC2mfjmvECWMlFS9b-nMF1k-alg4Y8,7756
@@ -72,7 +72,7 @@ dara/core/js_tooling/templates/.npmrc,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
72
72
  dara/core/js_tooling/templates/_entry.template.tsx,sha256=oTeiSLDmq4J-2pM7qjA2RgUocT6Rla7BNwyEAJGvdCc,161
73
73
  dara/core/js_tooling/templates/_entry_autojs.template.tsx,sha256=OtdXqH4kshaMiTk7E6gvccbVKU1UN-ShRKA9gLpu22E,217
74
74
  dara/core/js_tooling/templates/dara.config.json,sha256=RZG_R_xJv_5rYIoz2QZulcG49wD0JURTzshtAzG_di4,84
75
- dara/core/js_tooling/templates/vite.config.template.ts,sha256=d85cmO9p41QBL6X-HM-WdRwVoVA3JWOn9w2IZXZLg3I,590
75
+ dara/core/js_tooling/templates/vite.config.template.ts,sha256=f7_DbAQPDq6FJcOFJDnf2bMtzsvGWnN6VclRJjVdql8,631
76
76
  dara/core/log_configs/logging.yaml,sha256=YJyD18psAmSVz6587dcEOyoulLuRFFu1g8yMXl1ylM0,706
77
77
  dara/core/logging.py,sha256=QXf8qQDNdh5UW5-jnYwFz7U7KDmhPiZXmObBal_mwPo,13093
78
78
  dara/core/main.py,sha256=bl-Sjcgh0Hb-iYoCAuiMlkoG-fN8Erhwa5Nw3HGv_cc,17899
@@ -81,7 +81,7 @@ dara/core/metrics/cache.py,sha256=ybofUhZO0TCHeyhB_AtldWk1QTmTKh7GucTXpOkeTFA,25
81
81
  dara/core/metrics/runtime.py,sha256=YP-6Dz0GeI9_Yr7bUk_-OqShyFySGH_AKpDO126l6es,1833
82
82
  dara/core/metrics/utils.py,sha256=rYlBinxFc7VehFT5cTNXLk8gC74UEj7ZGq6vLgIDpSg,2247
83
83
  dara/core/persistence.py,sha256=TO94rPAN7jxZKVCC5YA4eE7GGDoNlCPe-BkkItV2VUE,10379
84
- dara/core/umd/dara.core.umd.js,sha256=dVItBDadKZ8c6QQ_z-vwUA1vDCuhpmf2hvGcKIiryG8,4878177
84
+ dara/core/umd/dara.core.umd.js,sha256=xHduhIjStK_x2rjCYi8RzAE7w9v9C6ET6k1kd7_75pc,4878180
85
85
  dara/core/umd/style.css,sha256=YQtQ4veiSktnyONl0CU1iU1kKfcQhreH4iASi1MP7Ak,4095007
86
86
  dara/core/visual/__init__.py,sha256=QN0wbG9HPQ_vXh8BO8DnBXeYLIENVTNtRmYzZf1lx7c,577
87
87
  dara/core/visual/components/__init__.py,sha256=O-Em_glGdZNO0LLl2RWmJSrQiXKxliXg_PuhVXGT81I,1811
@@ -105,8 +105,8 @@ dara/core/visual/themes/__init__.py,sha256=aM4mgoIYo2neBSw5FRzswsht7PUKjLthiHLmF
105
105
  dara/core/visual/themes/dark.py,sha256=UQGDooOc8ric73eHs9E0ltYP4UCrwqQ3QxqN_fb4PwY,1942
106
106
  dara/core/visual/themes/definitions.py,sha256=m3oN0txs65MZepqjj7AKMMxybf2aq5fTjcTwJmHqEbk,2744
107
107
  dara/core/visual/themes/light.py,sha256=-Tviq8oEwGbdFULoDOqPuHO0UpAZGsBy8qFi0kAGolQ,1944
108
- dara_core-1.12.7.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
109
- dara_core-1.12.7.dist-info/METADATA,sha256=5ED4Hbk7NxAPv1eYQO3zB-jxb49mPTrYW3e2ar_hs9A,6771
110
- dara_core-1.12.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
- dara_core-1.12.7.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
112
- dara_core-1.12.7.dist-info/RECORD,,
108
+ dara_core-1.13.0.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
109
+ dara_core-1.13.0.dist-info/METADATA,sha256=0f5jmYg7f6oUjFAKVhtGFHXOTR-Y1gQczFqFuHY74iE,6771
110
+ dara_core-1.13.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
+ dara_core-1.13.0.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
112
+ dara_core-1.13.0.dist-info/RECORD,,