Skip to content

Commit 0c73372

Browse files
committed
feat: better vis data mocking
1 parent d647408 commit 0c73372

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

local_dev/tools/insert_visualization.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@ def insert_visualization(vis_id):
44
# load the vis data from file
55
with open(f"{vis_id}.json", "r") as f:
66
data = f.read()
7+
78
payload = {}
89
payload["vis_id"] = vis_id
9-
# data is expected to be a json string
10+
payload['vis_title'] = 'Title'
11+
payload['vis_clean_query'] = 'DP0878177'
12+
payload['vis_query'] = 'DP0878177'
13+
payload['vis_params'] = "{\"from\":\"1665-01-01\",\"to\":\"2022-06-21\",\"document_types\":[\"121\"],\"sorting\":\"most-relevant\",\"min_descsize\":\"300\"}"
1014
payload["data"] = data
15+
1116
# the post target may need to be adjusted to work with the current local docker network
1217
res = requests.post("http://127.0.0.1:8081/dev/persistence/createVisualization/dev",
1318
json=payload)
1419
print(res.status_code)
1520
print(res.text)
16-
21+
1722

1823
def main():
1924
vis_ids = [

0 commit comments

Comments
 (0)