dara-core 1.12.2__py3-none-any.whl → 1.12.4__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.
@@ -17,6 +17,7 @@ limitations under the License.
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
+ import re
20
21
  from datetime import datetime, timezone
21
22
  from enum import Enum
22
23
  from typing import Any, List, Optional, Tuple, Union
@@ -27,6 +28,8 @@ from pydantic import BaseModel
27
28
 
28
29
  from dara.core.logging import dev_logger
29
30
 
31
+ COLUMN_PREFIX_REGEX = re.compile(r'__(?:col|index)__\d+__')
32
+
30
33
 
31
34
  class Pagination(BaseModel):
32
35
  """
@@ -207,10 +210,10 @@ def _filter_to_series(data: DataFrame, column: str, operator: QueryOperator, val
207
210
 
208
211
  def _resolve_filter_query(data: DataFrame, query: FilterQuery) -> 'Optional[Series[bool]]':
209
212
  """
210
- Resolve a FilterQuery to a Series[bool] for filtering
213
+ Resolve a FilterQuery to a Series[bool] for filtering. Strips the internal column index from the query.
211
214
  """
212
215
  if isinstance(query, ValueQuery):
213
- return _filter_to_series(data, query.column, query.operator, query.value)
216
+ return _filter_to_series(data, re.sub(COLUMN_PREFIX_REGEX, '', query.column, 1), query.operator, query.value)
214
217
  elif isinstance(query, ClauseQuery):
215
218
  filters = None
216
219
 
@@ -271,7 +274,9 @@ def apply_filters(
271
274
  order_by = order_by[1:]
272
275
  ascending = False
273
276
 
274
- new_data = new_data.sort_values(by=order_by, ascending=ascending, inplace=False)
277
+ new_data = new_data.sort_values(
278
+ by=re.sub(COLUMN_PREFIX_REGEX, '', order_by), ascending=ascending, inplace=False
279
+ )
275
280
 
276
281
  # PAGINATE
277
282
  start_index = pagination.offset if pagination.offset is not None else 0
@@ -55,6 +55,9 @@ class RegistryLookup:
55
55
  if registry.name in self.handlers:
56
56
  func = self.handlers[registry.name] # type: ignore
57
57
  entry = await func(uid)
58
+ # If something else registered the entry while we were waiting, return that
59
+ if registry.has(uid):
60
+ return registry.get(uid)
58
61
  registry.register(uid, entry)
59
62
  return entry
60
63
  raise ValueError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dara-core
3
- Version: 1.12.2
3
+ Version: 1.12.4
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.2)
23
+ Requires-Dist: create-dara-app (==1.12.4)
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.2) ; extra == "all"
26
+ Requires-Dist: dara-components (==1.12.4) ; 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.2/img/dara_light.svg?raw=true">
54
+ <img src="https://github.com/causalens/dara/blob/v1.12.4/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.2/img/components_gallery.png?raw=true)
99
+ ![Dara App](https://github.com/causalens/dara/blob/v1.12.4/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.2/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.2/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.2/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.12.4/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.4/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.4/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.2/CONTRIBUTING.md) file.
130
+ More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.12.4/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.2/LICENSE).
134
+ Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.12.4/LICENSE).
135
135
 
@@ -22,7 +22,7 @@ dara/core/interactivity/condition.py,sha256=ynK53cGuVMC852X6kkbrgltcdpIX7Otw7j1D
22
22
  dara/core/interactivity/data_variable.py,sha256=KIN2V2ipESfhczBtmyPnZUi0iirlZXdN1S1P0aPPVRA,11099
23
23
  dara/core/interactivity/derived_data_variable.py,sha256=Y3Yw5gdnjvVIUrZhyHafCEaQZMyVT9S5SJ7sC8lcYxA,15176
24
24
  dara/core/interactivity/derived_variable.py,sha256=6xOv-E5wQj-fd9S2RVmRdE_DfkvxVGyptfZlDSj0fmY,21497
25
- dara/core/interactivity/filtering.py,sha256=F80lkbI6_9wfEiV6jRDA7p4RWIFPwFqOQ6bf8JerfaI,8815
25
+ dara/core/interactivity/filtering.py,sha256=RniL8Qq9HIzY0D3p6ZXFQD363ksqZ6b7uCxtklUILyo,9035
26
26
  dara/core/interactivity/non_data_variable.py,sha256=ewPaNaTpMixR5YCVY1pjmyHgeC53K0CsjQxMusbJsiw,1147
27
27
  dara/core/interactivity/plain_variable.py,sha256=iuISw0x14ruOnZqrRg1Zay6ny7Ey0QImRUHVg0S11e0,8017
28
28
  dara/core/interactivity/url_variable.py,sha256=DEHEvg1mE7xXlK69p1D5iZZbf4emzNe6r_RH6DHcyoc,4219
@@ -53,7 +53,7 @@ dara/core/internal/pool/worker.py,sha256=CkDZRoqkl-6BsJLeJCyYCoBaaOaX9i3Cq5v8qe1
53
53
  dara/core/internal/port_utils.py,sha256=AQOUNiFNBYKVUwQ7i9UlY1NQ3sWb5xh5GkO6P1Bm6zU,1655
54
54
  dara/core/internal/registries.py,sha256=9WDczIsNeSmzi6aViIq_b14lmmYGGkdsUGHpv0Sg9zo,3278
55
55
  dara/core/internal/registry.py,sha256=ONCDusqaL0q59Py_r8-fFVN3vbkkDf5TXzNvbB9SrGQ,4305
56
- dara/core/internal/registry_lookup.py,sha256=bUtb3lJYYM9NdHUtSWhizKkmTfM3STkoD6t1H3igvnc,2063
56
+ dara/core/internal/registry_lookup.py,sha256=8snHu2wUUsngXjHyHh6eZqL_WwonTTQB6-WBX-R_WZg,2238
57
57
  dara/core/internal/routing.py,sha256=mdFOz8Q7g0IWUAl-qR5cHzK9qXn8QbNHhTuKVrxTp7E,22530
58
58
  dara/core/internal/scheduler.py,sha256=z6OYwazBf3GYo8CzMC9IuGC2P96gI7JwxquT8GaoTMk,12944
59
59
  dara/core/internal/settings.py,sha256=wAWxl-HXjq7PW3twe_CrR-UuMRw9VBudC3eRmevZAhM,3869
@@ -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.2.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
109
- dara_core-1.12.2.dist-info/METADATA,sha256=UyLaec8D_rZ2aq1bjfoZ-hupcUbf4Yy8pDEORJeugsM,6771
110
- dara_core-1.12.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
- dara_core-1.12.2.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
112
- dara_core-1.12.2.dist-info/RECORD,,
108
+ dara_core-1.12.4.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
109
+ dara_core-1.12.4.dist-info/METADATA,sha256=kQSyg7YDJh31Z6uHrVx9mOnmE7sObbF7858Iu4SLnns,6771
110
+ dara_core-1.12.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
+ dara_core-1.12.4.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
112
+ dara_core-1.12.4.dist-info/RECORD,,