Skip to content

Commit eae231a

Browse files
Hotfix (#204)
1 parent 6b81540 commit eae231a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

controller/data_slice/manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
from typing import Dict, Any, List, Optional
23

34
from submodules.model import DataSlice
@@ -78,7 +79,7 @@ def create_data_slice(
7879
project_id=project_id,
7980
created_by=user_id,
8081
name=name,
81-
filter_raw=filter_raw,
82+
filter_raw=json.loads(filter_raw),
8283
filter_data=filter_data,
8384
static=static,
8485
slice_type=slice_type,

fast_api/routes/data_slices.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ def get_data_slices(
2525
) -> List:
2626

2727
values = [
28-
sql_alchemy_to_dict(ds, for_frontend=True)
28+
sql_alchemy_to_dict(ds, for_frontend=False)
2929
for ds in manager.get_all_data_slices(project_id, slice_type)
3030
]
3131
for v in values:
32-
v["filterData"] = json.dumps(v["filterData"])
33-
del v["countSql"]
32+
v["filterData"] = json.dumps(v["filter_data"])
33+
v["filterRaw"] = json.dumps(v["filter_raw"])
34+
del v["count_sql"]
3435
return pack_json_result(
35-
{"data": {"dataSlices": wrap_content_for_frontend(values)}},
36+
{"data": {"dataSlices": values}},
3637
)
3738

3839

0 commit comments

Comments
 (0)