dara-core 1.12.6__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(
@@ -274,14 +274,16 @@ def apply_filters(
274
274
  order_by = order_by[1:]
275
275
  ascending = False
276
276
 
277
- new_data = new_data.sort_values(
278
- by=re.sub(COLUMN_PREFIX_REGEX, '', order_by), ascending=ascending, inplace=False
279
- )
277
+ col = re.sub(COLUMN_PREFIX_REGEX, '', order_by)
278
+ if col == 'index':
279
+ new_data = new_data.sort_index(ascending=ascending, inplace=False)
280
+ else:
281
+ new_data = new_data.sort_values(by=col, ascending=ascending, inplace=False)
280
282
 
281
283
  # PAGINATE
282
284
  start_index = pagination.offset if pagination.offset is not None else 0
283
285
  stop_index = start_index + pagination.limit if pagination.limit is not None else total_count
284
286
 
285
- new_data = new_data[start_index:stop_index]
287
+ new_data = new_data.iloc[start_index:stop_index]
286
288
 
287
289
  return new_data, total_count
@@ -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
  });
@@ -20681,7 +20681,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
20681
20681
  var _a;
20682
20682
  return jsxRuntime.exports.jsxs(Wrapper$8, { className: props.className, style: props.style, children: [jsxRuntime.exports.jsxs(Loader, { color: props.color, size: props.size, children: [jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" })] }), (props.showText || props.text) && jsxRuntime.exports.jsx(LoadingText, { color: props.color, children: (_a = props.text) !== null && _a !== void 0 ? _a : "LOADING" })] });
20683
20683
  }
20684
- var __rest$7 = globalThis && globalThis.__rest || function(s, e3) {
20684
+ var __rest$8 = globalThis && globalThis.__rest || function(s, e3) {
20685
20685
  var t2 = {};
20686
20686
  for (var p2 in s)
20687
20687
  if (Object.prototype.hasOwnProperty.call(s, p2) && e3.indexOf(p2) < 0)
@@ -20787,7 +20787,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
20787
20787
  secondary: SecondaryButton
20788
20788
  };
20789
20789
  function Button(_a, ref) {
20790
- var { autoFocus, children, className, disabled: disabled2, download, href, loading, id, onClick, outline = false, style, styling = "primary", type = "button" } = _a, props = __rest$7(_a, ["autoFocus", "children", "className", "disabled", "download", "href", "loading", "id", "onClick", "outline", "style", "styling", "type"]);
20790
+ var { autoFocus, children, className, disabled: disabled2, download, href, loading, id, onClick, outline = false, style, styling = "primary", type = "button" } = _a, props = __rest$8(_a, ["autoFocus", "children", "className", "disabled", "download", "href", "loading", "id", "onClick", "outline", "style", "styling", "type"]);
20791
20791
  const currentTheme = useClTheme();
20792
20792
  const Component = stylingMap[styling];
20793
20793
  const content = loading ? jsxRuntime.exports.jsx(StyledLoading, { color: outline ? currentTheme.colors.grey2 : currentTheme.colors.blue1 }) : children;
@@ -26438,7 +26438,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
26438
26438
 
26439
26439
  width: 100%;
26440
26440
  height: 100%;
26441
- min-height: 3.6rem;
26441
+ min-height: 3.4rem;
26442
26442
  padding: 1rem;
26443
26443
 
26444
26444
  font-size: 1rem;
@@ -26449,14 +26449,14 @@ var __privateWrapper = (obj, member, setter, getter) => ({
26449
26449
  border-radius: 0.25rem;
26450
26450
  outline: 0;
26451
26451
 
26452
- :focus:not(:disabled) {
26453
- border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey3};
26454
- }
26455
-
26456
26452
  :hover:not(:disabled) {
26457
26453
  border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey2};
26458
26454
  }
26459
26455
 
26456
+ :focus:not(:disabled) {
26457
+ border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey3};
26458
+ }
26459
+
26460
26460
  :active:not(:disabled) {
26461
26461
  border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey3};
26462
26462
  }
@@ -29685,8 +29685,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29685
29685
  }
29686
29686
 
29687
29687
  blockquote {
29688
- /* stylelint-disable-next-line */
29689
- quotes: '"\\201C""\\201D""\\2018""\\2019"';
29688
+ quotes: '\\201C' '\\201D' '\\2018' '\\2019';
29690
29689
 
29691
29690
  margin-top: 1.5rem;
29692
29691
  margin-bottom: 1.5rem;
@@ -29697,6 +29696,14 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29697
29696
  color: ${(props) => props.theme.colors.grey6};
29698
29697
 
29699
29698
  border-left: 0.25rem solid ${(props) => props.theme.colors.grey3};
29699
+
29700
+ p:first-of-type::before {
29701
+ content: open-quote;
29702
+ }
29703
+
29704
+ p:last-of-type::after {
29705
+ content: close-quote;
29706
+ }
29700
29707
  }
29701
29708
 
29702
29709
  h1 {
@@ -29709,7 +29716,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29709
29716
  }
29710
29717
 
29711
29718
  h2 {
29712
- margin-top: 1rem;
29719
+ margin-top: 2rem;
29713
29720
  margin-bottom: 1rem;
29714
29721
 
29715
29722
  font-size: 2rem;
@@ -29744,6 +29751,13 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29744
29751
  }
29745
29752
  }
29746
29753
 
29754
+ figcaption {
29755
+ margin-top: 0.875rem;
29756
+ font-size: 0.875rem;
29757
+ line-height: 1.5rem;
29758
+ color: ${(props) => props.theme.colors.grey5};
29759
+ }
29760
+
29747
29761
  h2 code {
29748
29762
  font-size: 0.875rem;
29749
29763
  }
@@ -29811,10 +29825,6 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29811
29825
  border-radius: 0.25rem;
29812
29826
  }
29813
29827
 
29814
- strong {
29815
- font-style: italic;
29816
- }
29817
-
29818
29828
  p {
29819
29829
  margin-top: 0.75rem;
29820
29830
  margin-bottom: 0.75rem;
@@ -29830,20 +29840,42 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29830
29840
  }
29831
29841
  }
29832
29842
 
29843
+ ol > li::marker {
29844
+ font-weight: 400;
29845
+ color: ${(props) => props.theme.colors.text};
29846
+ }
29847
+
29848
+ ul > li::marker {
29849
+ color: ${(props) => props.theme.colors.grey4};
29850
+ }
29851
+
29833
29852
  hr {
29834
29853
  margin-top: 3rem;
29835
29854
  margin-bottom: 3rem;
29836
29855
  }
29837
29856
 
29838
29857
  table {
29858
+ table-layout: auto;
29859
+ border-collapse: collapse;
29860
+
29861
+ width: 100%;
29862
+ margin-top: 2rem;
29863
+ margin-bottom: 2rem;
29864
+
29839
29865
  font-size: 0.875rem;
29840
29866
  line-height: 1.7;
29841
29867
 
29842
29868
  thead {
29869
+ border-bottom: 1px solid ${(props) => props.theme.colors.grey3};
29870
+
29843
29871
  th {
29844
29872
  padding-right: 0.5rem;
29845
29873
  padding-bottom: 0.5rem;
29846
29874
  padding-left: 0.5rem;
29875
+
29876
+ font-weight: 600;
29877
+ text-align: start;
29878
+ vertical-align: bottom;
29847
29879
  }
29848
29880
 
29849
29881
  th:first-child {
@@ -29855,17 +29887,36 @@ var __privateWrapper = (obj, member, setter, getter) => ({
29855
29887
  }
29856
29888
  }
29857
29889
 
29858
- tbody {
29890
+ tfoot {
29891
+ border-top: 1px solid ${(props) => props.theme.colors.grey2};
29892
+
29859
29893
  td {
29860
- padding: 0.5rem;
29894
+ text-align: start;
29895
+ vertical-align: top;
29861
29896
  }
29897
+ }
29862
29898
 
29863
- td:first-child {
29864
- padding-left: 0;
29899
+ tbody {
29900
+ tr {
29901
+ border-bottom: 1px solid ${(props) => props.theme.colors.grey2};
29902
+
29903
+ &:last-child {
29904
+ border-bottom: 0;
29905
+ }
29865
29906
  }
29866
29907
 
29867
- td:last-child {
29868
- padding-right: 0;
29908
+ td {
29909
+ padding: 0.5rem;
29910
+ text-align: start;
29911
+ vertical-align: baseline;
29912
+
29913
+ &:first-child {
29914
+ padding-left: 0;
29915
+ }
29916
+
29917
+ &:last-child {
29918
+ padding-right: 0;
29919
+ }
29869
29920
  }
29870
29921
  }
29871
29922
  }
@@ -34222,7 +34273,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
34222
34273
  return jsxRuntime.exports.jsx(CheckboxWrapper, { "aria-disabled": props.disabled, children: jsxRuntime.exports.jsx(Checkbox, { disabled: isSelectPermitted ? props.disabled : ((_a = checkedState.find((option) => option.value === item.value)) === null || _a === void 0 ? void 0 : _a.state) === false, id: index2, isListStyle: props.isListStyle, label: item.label ? item.label : item.value, onChange: (checked, e3) => onChangeValue(e3), selected: (_b = checkedState.find((option) => option.value === item.value)) === null || _b === void 0 ? void 0 : _b.state }) }, `item-${index2}`);
34223
34274
  })] });
34224
34275
  }
34225
- var __rest$6 = globalThis && globalThis.__rest || function(s, e3) {
34276
+ var __rest$7 = globalThis && globalThis.__rest || function(s, e3) {
34226
34277
  var t2 = {};
34227
34278
  for (var p2 in s)
34228
34279
  if (Object.prototype.hasOwnProperty.call(s, p2) && e3.indexOf(p2) < 0)
@@ -34278,35 +34329,25 @@ var __privateWrapper = (obj, member, setter, getter) => ({
34278
34329
  color: ${(props) => props.theme.colors.error};
34279
34330
  `;
34280
34331
  const Input$1 = React.forwardRef((_a, ref) => {
34281
- var { type = "text" } = _a, props = __rest$6(_a, ["type"]);
34282
- const onChange2 = (e3) => {
34332
+ var { type = "text", onChange: onChange2, onKeyDown, keydownFilter, onComplete, maxValue, minValue, errorMsg, className, style, initialValue } = _a, rest = __rest$7(_a, ["type", "onChange", "onKeyDown", "keydownFilter", "onComplete", "maxValue", "minValue", "errorMsg", "className", "style", "initialValue"]);
34333
+ const handleChange = (e3) => {
34283
34334
  const target = e3.target;
34284
- if (props.onChange) {
34285
- props.onChange(target.value, e3);
34335
+ if (onChange2) {
34336
+ onChange2(target.value, e3);
34286
34337
  }
34287
34338
  };
34288
- const onKeyDown = (e3) => {
34289
- if (props.onKeyDown) {
34290
- props.onKeyDown(e3);
34339
+ const handleKeyDown = (e3) => {
34340
+ if (onKeyDown) {
34341
+ onKeyDown(e3);
34291
34342
  }
34292
- if (props.keydownFilter && !props.keydownFilter(e3)) {
34343
+ if (keydownFilter && !keydownFilter(e3)) {
34293
34344
  e3.preventDefault();
34294
34345
  }
34295
- if (e3.key === Key.ENTER && props.onComplete) {
34296
- props.onComplete();
34297
- }
34298
- };
34299
- const addOptionalItems = () => {
34300
- const result = {};
34301
- if (props.minValue) {
34302
- result.minValue = props.minValue;
34303
- }
34304
- if (props.maxValue) {
34305
- result.maxValue = props.minValue;
34346
+ if (e3.key === Key.ENTER && onComplete) {
34347
+ onComplete();
34306
34348
  }
34307
- return result;
34308
34349
  };
34309
- return jsxRuntime.exports.jsxs(InputWrapper$3, { className: props.className, style: props.style, children: [jsxRuntime.exports.jsx(PrimaryInput, Object.assign({ autoFocus: props.autoFocus, defaultValue: props.initialValue, disabled: props.disabled, isErrored: !!props.errorMsg, maxLength: props.maxLength, onBlur: props.onBlur, onChange: onChange2, onClick: props.onClick, onKeyDown, placeholder: props.placeholder, ref, type, value: props.value }, addOptionalItems())), props.errorMsg && jsxRuntime.exports.jsxs(ErrorMessage$1, { children: [props.errorMsg, " "] })] });
34350
+ return jsxRuntime.exports.jsxs(InputWrapper$3, { className, style, children: [jsxRuntime.exports.jsx(PrimaryInput, Object.assign({}, rest, { defaultValue: initialValue, isErrored: !!errorMsg, onChange: handleChange, onKeyDown: handleKeyDown, ref, type, min: minValue, max: maxValue })), errorMsg && jsxRuntime.exports.jsx(ErrorMessage$1, { children: errorMsg })] });
34310
34351
  });
34311
34352
  Input$1.displayName = "Input";
34312
34353
  const Wrapper$7 = styled__default.default.div`
@@ -36572,7 +36613,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
36572
36613
  keyNavigationNext: "ArrowRight",
36573
36614
  keyNavigationPrevious: "ArrowLeft"
36574
36615
  });
36575
- var __rest$5 = globalThis && globalThis.__rest || function(s, e3) {
36616
+ var __rest$6 = globalThis && globalThis.__rest || function(s, e3) {
36576
36617
  var t2 = {};
36577
36618
  for (var p2 in s)
36578
36619
  if (Object.prototype.hasOwnProperty.call(s, p2) && e3.indexOf(p2) < 0)
@@ -36593,11 +36634,11 @@ var __privateWrapper = (obj, member, setter, getter) => ({
36593
36634
  background-color: transparent !important;
36594
36635
  `;
36595
36636
  const ChevronButton = (_a) => {
36596
- var { getToggleButtonProps, disabled: disabled2, isOpen } = _a, props = __rest$5(_a, ["getToggleButtonProps", "disabled", "isOpen"]);
36637
+ var { getToggleButtonProps, disabled: disabled2, isOpen } = _a, props = __rest$6(_a, ["getToggleButtonProps", "disabled", "isOpen"]);
36597
36638
  return jsxRuntime.exports.jsx(StyledChevronButton, Object.assign({}, getToggleButtonProps(), props, { children: jsxRuntime.exports.jsx(Chevron$2, { disabled: disabled2, isOpen }) }));
36598
36639
  };
36599
36640
  const ChevronButton$1 = React__default.default.memo(ChevronButton);
36600
- var __rest$4 = globalThis && globalThis.__rest || function(s, e3) {
36641
+ var __rest$5 = globalThis && globalThis.__rest || function(s, e3) {
36601
36642
  var t2 = {};
36602
36643
  for (var p2 in s)
36603
36644
  if (Object.prototype.hasOwnProperty.call(s, p2) && e3.indexOf(p2) < 0)
@@ -36650,7 +36691,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
36650
36691
  }
36651
36692
  `;
36652
36693
  const ListItem = ({ size: size2, title, item, index: index2, getItemProps, itemClass, children, isHighlighted, isSelected }) => {
36653
- const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$4(_a, ["itemClassName"]);
36694
+ const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$5(_a, ["itemClassName"]);
36654
36695
  return jsxRuntime.exports.jsx(StyledListItem, Object.assign({}, itemProps, { className: itemClass ? `${itemClassName} ${itemClass}` : itemClassName, title, size: size2, item, isHighlighted, isSelected, children }));
36655
36696
  };
36656
36697
  ListItem.displayName = "ListItem";
@@ -43240,7 +43281,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
43240
43281
  } }]), a2;
43241
43282
  }(), jt = "input", Ht = "navigate";
43242
43283
  const reactDatepicker = "";
43243
- var __rest$3 = globalThis && globalThis.__rest || function(s, e3) {
43284
+ var __rest$4 = globalThis && globalThis.__rest || function(s, e3) {
43244
43285
  var t2 = {};
43245
43286
  for (var p2 in s)
43246
43287
  if (Object.prototype.hasOwnProperty.call(s, p2) && e3.indexOf(p2) < 0)
@@ -43372,7 +43413,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
43372
43413
  }
43373
43414
  `;
43374
43415
  const DatepickerListItem = React__namespace.memo(({ item, index: index2, getItemProps, isSelected, size: size2, isHighlighted }) => {
43375
- const _a = getItemProps({ index: index2, item }), itemProps = __rest$3(_a, ["itemClassName"]);
43416
+ const _a = getItemProps({ index: index2, item }), itemProps = __rest$4(_a, ["itemClassName"]);
43376
43417
  return jsxRuntime.exports.jsx(StyledDatepickerListItem, Object.assign({}, itemProps, { isSelected, title: item.label, item, index: index2, size: size2, isHighlighted, children: item.label }));
43377
43418
  });
43378
43419
  const StyledDropdownList = React__namespace.memo(styled__default.default(DropdownList$1)`
@@ -45466,6 +45507,18 @@ var __privateWrapper = (obj, member, setter, getter) => ({
45466
45507
  const stepDown = () => step(amountToStep * -1);
45467
45508
  return jsxRuntime.exports.jsxs(StepperWrapper, { disabled: disabled2, children: [jsxRuntime.exports.jsx(StepperButton, { disabled: disabled2, onClick: stepUp, styling: "ghost", tabIndex: -1, children: jsxRuntime.exports.jsx(ChevronUp, {}) }), jsxRuntime.exports.jsx(StepperButton, { disabled: disabled2, onClick: stepDown, styling: "ghost", tabIndex: -1, children: jsxRuntime.exports.jsx(ChevronDown, {}) })] });
45468
45509
  };
45510
+ var __rest$3 = globalThis && globalThis.__rest || function(s, e3) {
45511
+ var t2 = {};
45512
+ for (var p2 in s)
45513
+ if (Object.prototype.hasOwnProperty.call(s, p2) && e3.indexOf(p2) < 0)
45514
+ t2[p2] = s[p2];
45515
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
45516
+ for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s); i2 < p2.length; i2++) {
45517
+ if (e3.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i2]))
45518
+ t2[p2[i2]] = s[p2[i2]];
45519
+ }
45520
+ return t2;
45521
+ };
45469
45522
  const InputWrapper$1 = styled__default.default.div`
45470
45523
  display: flex;
45471
45524
  flex-direction: row;
@@ -45557,27 +45610,27 @@ var __privateWrapper = (obj, member, setter, getter) => ({
45557
45610
  }
45558
45611
  return "";
45559
45612
  };
45560
- React__namespace.forwardRef((props, ref) => {
45613
+ React__namespace.forwardRef((_a, ref) => {
45614
+ var { value, onChange: onChange2, initialValue } = _a, props = __rest$3(_a, ["value", "onChange", "initialValue"]);
45561
45615
  const keydownFilter = React.useMemo(() => numericFilter(props.integerOnly), [props.integerOnly]);
45562
- const [input, setInput] = React.useState(getInitialValue(props.value, props.initialValue));
45563
- const step = (value) => {
45564
- var _a;
45616
+ const [input, setInput] = React.useState(getInitialValue(value, initialValue));
45617
+ const step = (v2) => {
45565
45618
  if (!input || input === "-") {
45566
45619
  return;
45567
45620
  }
45568
45621
  const isFloat = input.includes(".");
45569
45622
  const parsedValue = isFloat ? parseFloat(input) : parseInt(input);
45570
- let nextValueNumber = parsedValue + value;
45623
+ let nextValueNumber = parsedValue + v2;
45571
45624
  let nextValueStr = String(nextValueNumber);
45572
45625
  if (isFloat) {
45573
45626
  const decimals = input.split(".")[1];
45574
45627
  if (decimals) {
45575
- nextValueStr = (parsedValue + value / Math.pow(10, decimals.length)).toFixed(decimals.length);
45628
+ nextValueStr = (parsedValue + v2 / Math.pow(10, decimals.length)).toFixed(decimals.length);
45576
45629
  nextValueNumber = parseFloat(nextValueStr);
45577
45630
  }
45578
45631
  }
45579
- if (props.value !== void 0) {
45580
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, nextValueNumber, {
45632
+ if (value !== void 0) {
45633
+ onChange2 === null || onChange2 === void 0 ? void 0 : onChange2(nextValueNumber, {
45581
45634
  target: {
45582
45635
  value: nextValueStr
45583
45636
  }
@@ -45587,8 +45640,8 @@ var __privateWrapper = (obj, member, setter, getter) => ({
45587
45640
  }
45588
45641
  };
45589
45642
  const onKeyDown = (e3) => {
45590
- var _a, _b;
45591
- (_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e3);
45643
+ var _a2, _b;
45644
+ (_a2 = props.onKeyDown) === null || _a2 === void 0 ? void 0 : _a2.call(props, e3);
45592
45645
  if (!props.stepper) {
45593
45646
  return;
45594
45647
  }
@@ -45600,35 +45653,34 @@ var __privateWrapper = (obj, member, setter, getter) => ({
45600
45653
  step(stepSkip * -1);
45601
45654
  }
45602
45655
  };
45603
- const onChange2 = React.useCallback(
45604
- (value, e3) => {
45605
- var _a, _b;
45606
- const parsed = props.integerOnly ? parseInt(value) : parseFloat(value);
45607
- if (props.value === void 0) {
45608
- setInput(value);
45609
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, parsed, e3);
45656
+ const handleOnChange = React.useCallback(
45657
+ (v2, e3) => {
45658
+ const parsed = props.integerOnly ? parseInt(v2) : parseFloat(v2);
45659
+ if (value === void 0) {
45660
+ setInput(v2);
45661
+ onChange2 === null || onChange2 === void 0 ? void 0 : onChange2(parsed, e3);
45610
45662
  return;
45611
45663
  }
45612
- if (value.endsWith(".")) {
45613
- setInput(value);
45664
+ if (v2.endsWith(".")) {
45665
+ setInput(v2);
45614
45666
  return;
45615
45667
  }
45616
- if (value.includes(".") && value.endsWith("0")) {
45617
- setInput(value);
45668
+ if (v2.includes(".") && v2.endsWith("0")) {
45669
+ setInput(v2);
45618
45670
  return;
45619
45671
  }
45620
- if (value === "-") {
45621
- setInput(value);
45672
+ if (v2 === "-") {
45673
+ setInput(v2);
45622
45674
  return;
45623
45675
  }
45624
- (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, parsed, e3);
45676
+ onChange2 === null || onChange2 === void 0 ? void 0 : onChange2(parsed, e3);
45625
45677
  },
45626
- [props.integerOnly, props.value, props.onChange]
45678
+ [props.integerOnly, value, onChange2]
45627
45679
  );
45628
45680
  React.useEffect(() => {
45629
- setInput(getInitialValue(props.value, props.initialValue));
45630
- }, [props.value]);
45631
- return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsxs(InputWrapper$1, { disabled: props.disabled, errorMsg: props.errorMsg, stepper: props.stepper, style: props.style, children: [jsxRuntime.exports.jsx(Input$1, { autoFocus: props.autoFocus, className: props.className, disabled: props.disabled, keydownFilter, maxValue: props.maxValue, minValue: props.minValue, onBlur: props.onBlur, onChange: onChange2, onComplete: props.onComplete, onKeyDown, placeholder: props.placeholder, ref, value: input }), props.stepper && jsxRuntime.exports.jsx(InputStepper, { disabled: props.disabled, step, stepSkip: props.stepSkip })] }), props.errorMsg && jsxRuntime.exports.jsx(ErrorMessage$1, { children: props.errorMsg })] });
45681
+ setInput(getInitialValue(value, initialValue));
45682
+ }, [value]);
45683
+ return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsxs(InputWrapper$1, { disabled: props.disabled, errorMsg: props.errorMsg, stepper: props.stepper, style: props.style, children: [jsxRuntime.exports.jsx(Input$1, Object.assign({}, props, { keydownFilter, onChange: handleOnChange, onKeyDown, ref, value: input })), props.stepper && jsxRuntime.exports.jsx(InputStepper, { disabled: props.disabled, step, stepSkip: props.stepSkip })] }), props.errorMsg && jsxRuntime.exports.jsx(ErrorMessage$1, { children: props.errorMsg })] });
45632
45684
  });
45633
45685
  Input$1.displayName = "NumericInput";
45634
45686
  styled__default.default.div`
@@ -57572,12 +57624,12 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57572
57624
  const eventBus = useEventBus();
57573
57625
  const extras = useRequestExtras();
57574
57626
  const dataCallback = React.useCallback(
57575
- async (filters, pagination, withSchema = false) => {
57627
+ async (filters, pagination, options) => {
57576
57628
  const mergedFilters = combineFilters("AND", [variable.filters, filters]);
57577
57629
  const data = await fetchDataVariable(variable.uid, extras, mergedFilters, pagination);
57578
57630
  const [totalCount, schema = null] = await Promise.all([
57579
57631
  fetchDataVariableCount(variable.uid, extras, mergedFilters),
57580
- ...withSchema ? [fetchDataVariableSchema(variable.uid, extras)] : []
57632
+ ...(options == null ? void 0 : options.schema) ? [fetchDataVariableSchema(variable.uid, extras)] : []
57581
57633
  ]);
57582
57634
  eventBus.publish("DATA_VARIABLE_LOADED", { variable, value: { data, totalCount } });
57583
57635
  return {
@@ -57595,7 +57647,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57595
57647
  const extras = useRequestExtras();
57596
57648
  const previousResult = React.useRef({ data: null, totalCount: 0, schema: { fields: [], primaryKey: [] } });
57597
57649
  const dataCallback = React.useCallback(
57598
- async (filters, pagination, withSchema = false) => {
57650
+ async (filters, pagination, options) => {
57599
57651
  const mergedFilters = combineFilters("AND", [variable.filters, filters]);
57600
57652
  const dvValue = await dvValuePromise;
57601
57653
  const response = await fetchDerivedDataVariable(
@@ -57625,8 +57677,8 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57625
57677
  data = response;
57626
57678
  }
57627
57679
  const [totalCount, schema = null] = await Promise.all([
57628
- fetchDataVariableCount(variable.uid, extras, mergedFilters),
57629
- ...withSchema ? [fetchDataVariableSchema(variable.uid, extras)] : []
57680
+ fetchDataVariableCount(variable.uid, extras, mergedFilters, dvValue.cache_key),
57681
+ ...(options == null ? void 0 : options.schema) ? [fetchDataVariableSchema(variable.uid, extras, dvValue.cache_key)] : []
57630
57682
  ]);
57631
57683
  previousResult.current = {
57632
57684
  data,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dara-core
3
- Version: 1.12.6
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.6)
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.6) ; 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.6/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.6/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.6/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.6/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.6/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.6/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.6/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,9 +20,9 @@ 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
- dara/core/interactivity/filtering.py,sha256=RniL8Qq9HIzY0D3p6ZXFQD363ksqZ6b7uCxtklUILyo,9035
25
+ dara/core/interactivity/filtering.py,sha256=veQbDi4ogeDO5SODOp3hpx1FQGAYKFLwnhqmbfFDyJo,9168
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
@@ -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=eAzeW0wT8sdeoYKEmTdPPlD_OsxRP9PHJUTko912TAM,4876798
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.6.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
109
- dara_core-1.12.6.dist-info/METADATA,sha256=hw9ZCren224YQQEpDUsYd83NCGruzySuODIJU0ep_qQ,6771
110
- dara_core-1.12.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
- dara_core-1.12.6.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
112
- dara_core-1.12.6.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,,