dara-core 1.18.9__py3-none-any.whl → 1.18.11__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/interactivity/data_variable.py +2 -3
- dara/core/interactivity/derived_data_variable.py +2 -3
- dara/core/internal/pandas_utils.py +19 -1
- dara/core/umd/dara.core.umd.js +8 -4
- {dara_core-1.18.9.dist-info → dara_core-1.18.11.dist-info}/METADATA +10 -10
- {dara_core-1.18.9.dist-info → dara_core-1.18.11.dist-info}/RECORD +9 -9
- {dara_core-1.18.9.dist-info → dara_core-1.18.11.dist-info}/LICENSE +0 -0
- {dara_core-1.18.9.dist-info → dara_core-1.18.11.dist-info}/WHEEL +0 -0
- {dara_core-1.18.9.dist-info → dara_core-1.18.11.dist-info}/entry_points.txt +0 -0
|
@@ -22,7 +22,6 @@ from typing import Optional, Union, cast
|
|
|
22
22
|
|
|
23
23
|
from anyio.abc import TaskGroup
|
|
24
24
|
from pandas import DataFrame
|
|
25
|
-
from pandas.io.json._table_schema import build_table_schema
|
|
26
25
|
from pydantic import (
|
|
27
26
|
BaseModel,
|
|
28
27
|
ConfigDict,
|
|
@@ -44,7 +43,7 @@ from dara.core.interactivity.filtering import (
|
|
|
44
43
|
)
|
|
45
44
|
from dara.core.internal.cache_store import CacheStore
|
|
46
45
|
from dara.core.internal.hashing import hash_object
|
|
47
|
-
from dara.core.internal.pandas_utils import append_index, df_convert_to_internal
|
|
46
|
+
from dara.core.internal.pandas_utils import append_index, df_convert_to_internal, get_schema
|
|
48
47
|
from dara.core.internal.utils import call_async
|
|
49
48
|
from dara.core.internal.websocket import WebsocketManager
|
|
50
49
|
from dara.core.logging import eng_logger
|
|
@@ -230,7 +229,7 @@ class DataVariable(AnyDataVariable):
|
|
|
230
229
|
store.set(
|
|
231
230
|
var_entry,
|
|
232
231
|
key=cls._get_schema_cache_key(var_entry.uid),
|
|
233
|
-
value=
|
|
232
|
+
value=get_schema(df_convert_to_internal(entry.data)),
|
|
234
233
|
pin=True,
|
|
235
234
|
),
|
|
236
235
|
)
|
|
@@ -23,7 +23,6 @@ from typing import Any, Callable, List, Optional, Union, cast
|
|
|
23
23
|
from uuid import uuid4
|
|
24
24
|
|
|
25
25
|
from pandas import DataFrame
|
|
26
|
-
from pandas.io.json._table_schema import build_table_schema
|
|
27
26
|
from pydantic import ConfigDict, SerializerFunctionWrapHandler, model_serializer
|
|
28
27
|
|
|
29
28
|
from dara.core.base_definitions import (
|
|
@@ -52,7 +51,7 @@ from dara.core.interactivity.filtering import (
|
|
|
52
51
|
)
|
|
53
52
|
from dara.core.internal.cache_store import CacheStore
|
|
54
53
|
from dara.core.internal.hashing import hash_object
|
|
55
|
-
from dara.core.internal.pandas_utils import append_index, df_convert_to_internal
|
|
54
|
+
from dara.core.internal.pandas_utils import append_index, df_convert_to_internal, get_schema
|
|
56
55
|
from dara.core.internal.tasks import MetaTask, Task, TaskManager
|
|
57
56
|
from dara.core.logging import eng_logger
|
|
58
57
|
|
|
@@ -210,7 +209,7 @@ class DerivedDataVariable(AnyDataVariable, DerivedVariable):
|
|
|
210
209
|
store.set(
|
|
211
210
|
registry_entry=var_entry,
|
|
212
211
|
key=cls._get_schema_cache_key(value['cache_key']),
|
|
213
|
-
value=
|
|
212
|
+
value=get_schema(
|
|
214
213
|
df_convert_to_internal(cast(DataFrame, value['value'])),
|
|
215
214
|
)
|
|
216
215
|
if isinstance(value['value'], DataFrame)
|
|
@@ -65,6 +65,9 @@ def df_convert_to_internal(original_df: DataFrame) -> DataFrame:
|
|
|
65
65
|
if any(isinstance(c, str) and c.startswith('__col__') for c in df.columns):
|
|
66
66
|
return df
|
|
67
67
|
|
|
68
|
+
# Append index to match the way we process the original DataFrame
|
|
69
|
+
df = cast(DataFrame, append_index(df))
|
|
70
|
+
|
|
68
71
|
# Handle hierarchical columns: [(A, B), (A, C)] -> ['A_B', 'A_C']
|
|
69
72
|
if isinstance(df.columns, MultiIndex):
|
|
70
73
|
df.columns = ['_'.join(col).strip() if col[0] != INDEX else INDEX for col in df.columns.values]
|
|
@@ -90,4 +93,19 @@ def df_convert_to_internal(original_df: DataFrame) -> DataFrame:
|
|
|
90
93
|
|
|
91
94
|
|
|
92
95
|
def df_to_json(df: DataFrame) -> str:
|
|
93
|
-
return df_convert_to_internal(df).to_json(orient='records') or ''
|
|
96
|
+
return df_convert_to_internal(df).to_json(orient='records', date_unit='ns') or ''
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def get_schema(df: DataFrame):
|
|
100
|
+
from pandas.io.json._table_schema import build_table_schema
|
|
101
|
+
|
|
102
|
+
raw_schema = build_table_schema(df)
|
|
103
|
+
|
|
104
|
+
for field_data in cast(list, raw_schema['fields']):
|
|
105
|
+
if field_data.get('type') == 'datetime':
|
|
106
|
+
# for datetime fields we need to know the resolution, so we get the actual e.g. `datetime64[ns]` string
|
|
107
|
+
column_name = field_data.get('name')
|
|
108
|
+
dtype_str = str(df[column_name].dtype)
|
|
109
|
+
field_data['type'] = dtype_str
|
|
110
|
+
|
|
111
|
+
return raw_schema
|
dara/core/umd/dara.core.umd.js
CHANGED
|
@@ -39729,10 +39729,13 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
39729
39729
|
const unpackedItems = React.useMemo(() => unpackSectionedList(props.items), [props.items]);
|
|
39730
39730
|
const [pendingHighlight, setPendingHighlight] = React.useState(null);
|
|
39731
39731
|
const [items, setItems] = React.useState(unpackedItems);
|
|
39732
|
-
const [inputValue, setInputValue] = React.useState((
|
|
39732
|
+
const [inputValue, setInputValue] = React.useState(((_a = props.selectedItem) === null || _a === void 0 ? void 0 : _a.label) && props.selectedItem.label !== "null" ? props.selectedItem.label : (_b = props.placeholder) !== null && _b !== void 0 ? _b : "");
|
|
39733
39733
|
const [kbdHighlightIdx, setKbdHighlightIdx] = React__default.default.useState();
|
|
39734
39734
|
const { selectedItem, isOpen, getMenuProps, getInputProps, getToggleButtonProps, getItemProps, setHighlightedIndex } = useCombobox(Object.assign(Object.assign(Object.assign({ initialIsOpen: false, initialSelectedItem: (_c = props.initialValue) !== null && _c !== void 0 ? _c : props.selectedItem, itemToString: (item) => item ? item.label : "", items, onInputValueChange: (change) => {
|
|
39735
|
-
|
|
39735
|
+
const shouldUpdateInput = [stateChangeTypes.ItemClick, stateChangeTypes.InputChange].includes(change.type);
|
|
39736
|
+
if (shouldUpdateInput) {
|
|
39737
|
+
setInputValue(change.inputValue);
|
|
39738
|
+
}
|
|
39736
39739
|
if (!change.inputValue) {
|
|
39737
39740
|
setItems(unpackedItems);
|
|
39738
39741
|
return;
|
|
@@ -39797,10 +39800,11 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
39797
39800
|
}
|
|
39798
39801
|
}, [isOpen, pendingHighlight, setHighlightedIndex]);
|
|
39799
39802
|
React.useEffect(() => {
|
|
39803
|
+
var _a2;
|
|
39800
39804
|
if (props.selectedItem === null) {
|
|
39801
|
-
setInputValue("");
|
|
39805
|
+
setInputValue((_a2 = props.placeholder) !== null && _a2 !== void 0 ? _a2 : "");
|
|
39802
39806
|
}
|
|
39803
|
-
}, [props.selectedItem]);
|
|
39807
|
+
}, [props.selectedItem, props.placeholder]);
|
|
39804
39808
|
const { refs, floatingStyles, context: context2 } = useFloating({
|
|
39805
39809
|
open: isOpen,
|
|
39806
39810
|
placement: "bottom-start",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dara-core
|
|
3
|
-
Version: 1.18.
|
|
3
|
+
Version: 1.18.11
|
|
4
4
|
Summary: Dara Framework Core
|
|
5
5
|
Home-page: https://dara.causalens.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -21,10 +21,10 @@ Requires-Dist: cachetools (>=5.0.0,<6.0.0)
|
|
|
21
21
|
Requires-Dist: certifi (>=2024.7.4)
|
|
22
22
|
Requires-Dist: click (==8.1.3)
|
|
23
23
|
Requires-Dist: colorama (>=0.4.6,<0.5.0)
|
|
24
|
-
Requires-Dist: create-dara-app (==1.18.
|
|
24
|
+
Requires-Dist: create-dara-app (==1.18.11)
|
|
25
25
|
Requires-Dist: croniter (>=1.0.15,<3.0.0)
|
|
26
26
|
Requires-Dist: cryptography (>=42.0.4)
|
|
27
|
-
Requires-Dist: dara-components (==1.18.
|
|
27
|
+
Requires-Dist: dara-components (==1.18.11) ; extra == "all"
|
|
28
28
|
Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0)
|
|
29
29
|
Requires-Dist: fastapi (>=0.115.0,<0.116.0)
|
|
30
30
|
Requires-Dist: fastapi_vite_dara (==0.4.0)
|
|
@@ -55,7 +55,7 @@ Description-Content-Type: text/markdown
|
|
|
55
55
|
|
|
56
56
|
# Dara Application Framework
|
|
57
57
|
|
|
58
|
-
<img src="https://github.com/causalens/dara/blob/v1.18.
|
|
58
|
+
<img src="https://github.com/causalens/dara/blob/v1.18.11/img/dara_light.svg?raw=true">
|
|
59
59
|
|
|
60
60
|

|
|
61
61
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
@@ -100,7 +100,7 @@ source .venv/bin/activate
|
|
|
100
100
|
dara start
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-

|
|
104
104
|
|
|
105
105
|
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:
|
|
106
106
|
|
|
@@ -117,9 +117,9 @@ Explore some of our favorite apps - a great way of getting started and getting t
|
|
|
117
117
|
|
|
118
118
|
| Dara App | Description |
|
|
119
119
|
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
-
|  | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
|
|
121
|
+
|  | 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 |
|
|
122
|
+
|  | 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. |
|
|
123
123
|
|
|
124
124
|
Check out our [App Gallery](https://dara.causalens.com/gallery) for more inspiration!
|
|
125
125
|
|
|
@@ -146,9 +146,9 @@ And the supporting UI packages and tools.
|
|
|
146
146
|
- `ui-utils` - miscellaneous utility functions
|
|
147
147
|
- `ui-widgets` - widget components
|
|
148
148
|
|
|
149
|
-
More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.18.
|
|
149
|
+
More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.18.11/CONTRIBUTING.md) file.
|
|
150
150
|
|
|
151
151
|
## License
|
|
152
152
|
|
|
153
|
-
Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.18.
|
|
153
|
+
Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.18.11/LICENSE).
|
|
154
154
|
|
|
@@ -19,8 +19,8 @@ dara/core/interactivity/actions.py,sha256=7CwHN2gmdzffQzggsWqWW7ppNfdJ0MGSChZiVP
|
|
|
19
19
|
dara/core/interactivity/any_data_variable.py,sha256=BftnTPSDjOAqxTz_p4L0n5ngk8dvDip8nu9RZeBDI-c,5323
|
|
20
20
|
dara/core/interactivity/any_variable.py,sha256=8r9AIu6kBBFYsnTlYprEH8pxUM8RYXs0B2Hr09TrAuw,13678
|
|
21
21
|
dara/core/interactivity/condition.py,sha256=69tdxgLqNbU-AlwHTWFdp-hvxGDugNnb_McDrz0mDtE,1575
|
|
22
|
-
dara/core/interactivity/data_variable.py,sha256=
|
|
23
|
-
dara/core/interactivity/derived_data_variable.py,sha256=
|
|
22
|
+
dara/core/interactivity/data_variable.py,sha256=qnk6RNY2f4QkLsy5D-Eq-NF6rySmRDsTWie-yLBCdAk,11777
|
|
23
|
+
dara/core/interactivity/derived_data_variable.py,sha256=liPA_zr7R2dJUaeAFHvopSxxdia0zO_MRULbPKstWyg,15379
|
|
24
24
|
dara/core/interactivity/derived_variable.py,sha256=fU0IE6u8mLJyozYl2s0jmxjwPmU0J_Z7vO7KMsYkCTg,24262
|
|
25
25
|
dara/core/interactivity/filtering.py,sha256=Lce3YnBcC8T-DaLimH06zNcLun2iLm6dVTZerTJRrpA,9022
|
|
26
26
|
dara/core/interactivity/loop_variable.py,sha256=EqZX3bMCwKmI2Yu4pQ7TJG9hf3PY2AlAIBLxEzHFbTw,2998
|
|
@@ -45,7 +45,7 @@ dara/core/internal/execute_action.py,sha256=V5JmAkh-PoXHCNr0xcTtdw4UMOeY6VEOVvW_
|
|
|
45
45
|
dara/core/internal/hashing.py,sha256=Iz3FyiroHc_bC8AEtSUFFAIHh6j4Bq_EvxLqInIkAUM,1124
|
|
46
46
|
dara/core/internal/import_discovery.py,sha256=oyBZayWhfZma4bg-8bamnS4QO1Oba9geGtez_BHut38,8128
|
|
47
47
|
dara/core/internal/normalization.py,sha256=NDrj3QyqxSLL6sVgATYFehLAJp8IXSBul0h8kG2McAM,6265
|
|
48
|
-
dara/core/internal/pandas_utils.py,sha256=
|
|
48
|
+
dara/core/internal/pandas_utils.py,sha256=V_cQp1IARrqMJJ0n9r3qFQ8KrKlAgZmpPrbmzlKpQP0,3609
|
|
49
49
|
dara/core/internal/pool/__init__.py,sha256=pBbXE5GR3abVC9Lg3i0QxfdmsrBDMJUYAYb0SiAEBkk,657
|
|
50
50
|
dara/core/internal/pool/channel.py,sha256=TbyIE-PnfzzsQYhl3INOs5UIHHbF_h9bMFne5FjbWlQ,4948
|
|
51
51
|
dara/core/internal/pool/definitions.py,sha256=ICw_Krf-ziVGkzKl4qvvIgKC0Z06bvUehELH5-VMjV0,4645
|
|
@@ -83,7 +83,7 @@ dara/core/metrics/cache.py,sha256=c1PSst_oZZvuVzBXYWdpf8Sbb97u6q0HS2dlsEVLpQU,26
|
|
|
83
83
|
dara/core/metrics/runtime.py,sha256=YP-6Dz0GeI9_Yr7bUk_-OqShyFySGH_AKpDO126l6es,1833
|
|
84
84
|
dara/core/metrics/utils.py,sha256=inR1Ab5hmWZY2lsgGwLCQOEdyhCD9PumU52X2JbwlKY,2251
|
|
85
85
|
dara/core/persistence.py,sha256=qINdOxpyvlPGBB9Vy09TPWQnmk0ej4SzUx03AV1YbX0,18561
|
|
86
|
-
dara/core/umd/dara.core.umd.js,sha256
|
|
86
|
+
dara/core/umd/dara.core.umd.js,sha256=-E97fzLYCS1trZbl8W1MBZyGaP_A39WxRmX_HoWuCqQ,4736148
|
|
87
87
|
dara/core/umd/style.css,sha256=YQtQ4veiSktnyONl0CU1iU1kKfcQhreH4iASi1MP7Ak,4095007
|
|
88
88
|
dara/core/visual/__init__.py,sha256=QN0wbG9HPQ_vXh8BO8DnBXeYLIENVTNtRmYzZf1lx7c,577
|
|
89
89
|
dara/core/visual/components/__init__.py,sha256=wuGRk8bogiLWPOXAF-Fo4F6_L__0tBrI2p2SqgH2lnE,2385
|
|
@@ -107,8 +107,8 @@ dara/core/visual/themes/__init__.py,sha256=aM4mgoIYo2neBSw5FRzswsht7PUKjLthiHLmF
|
|
|
107
107
|
dara/core/visual/themes/dark.py,sha256=UQGDooOc8ric73eHs9E0ltYP4UCrwqQ3QxqN_fb4PwY,1942
|
|
108
108
|
dara/core/visual/themes/definitions.py,sha256=nS_gQvOzCt5hTmj74d0_siq_9QWuj6wNuir4VCHy0Dk,2779
|
|
109
109
|
dara/core/visual/themes/light.py,sha256=-Tviq8oEwGbdFULoDOqPuHO0UpAZGsBy8qFi0kAGolQ,1944
|
|
110
|
-
dara_core-1.18.
|
|
111
|
-
dara_core-1.18.
|
|
112
|
-
dara_core-1.18.
|
|
113
|
-
dara_core-1.18.
|
|
114
|
-
dara_core-1.18.
|
|
110
|
+
dara_core-1.18.11.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
|
|
111
|
+
dara_core-1.18.11.dist-info/METADATA,sha256=xAmFaqvg8_8IsOUdAksOa1oH9YKkAQ9HjLfDIw5ODkw,7550
|
|
112
|
+
dara_core-1.18.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
113
|
+
dara_core-1.18.11.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
|
|
114
|
+
dara_core-1.18.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|