def make_union(queries):
    return " UNION ".join("({})".format(query) for query in queries)
>>> make_union(["SELECT * from A", "SELECT * from B"])
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/monitoring/zabbix/sql_utils.py/make_union