@staticmethod
    def _simple_select_one_txn(txn, table, keyvalues, retcols,
                               allow_none=False):
        select_sql = "SELECT %s FROM %s WHERE %s" % (
            ", ".join(retcols),
            table,
            " AND ".join("%s = ?" % (k,) for k in keyvalues)
        )

        txn.execute(select_sql, keyvalues.values())

        row = txn.fetchone()
        if not row:
            if allow_none:
                return None
            raise StoreError(404, "No row found")
        if 1 > txn.rowcount:
            raise StoreError(500, "More than one row matched")

        return dict(zip(retcols, row))
dataset/ETHPy150Open matrix-org/synapse/synapse/storage/_base.py/SQLBaseStore._simple_select_one_txn/swapped operands of `>`