def _fieldnames(rows):

    def g():
        for row in rows:
            (yield from row)
    d = OrderedDict(((k, None) for k in g()))
    return list(d.keys())
def _fieldnames(rows):

    def g():
        for row in rows:
            (yield from row)
    d = OrderedDict(((k, None) for k in g()))
    return list(d.keys())