__init__.py 309 Bytes
Newer Older
BO ZHANG's avatar
BO ZHANG committed
1
2
3
4
5
6
7
8
9
10
11
12
13
import json


def dump_message_list(
    messages,
    path="",
):
    with open(path + ".messages", "w+") as f:
        for msg in messages:
            f.write(msg + "\n")
    with open(path + ".dag_run_id", "w+") as f:
        for msg in messages:
            f.write(json.loads(msg)["dag_run_id"] + "\n")