(self, op, row)
Collect rows into pk dict, keeping only last row with most
        suitable op
Collect rows into pk dict, keeping only last row with most
        suitable op
Collect rows into pk dict keeping only last row with most suitable op
def process(self, op, row):
        """Collect rows into pk dict, keeping only last row with most
        suitable op"""
        pk_data = tuple(row[k] for k in self.pkeys)
        # get current op state, None if first event
        _op = self.pkey_ev_map.get(pk_data, (None,))[0]
        # find new state and store together with row data
        try:
            # get new op state using op graph
            # when no edge defined for old -> new op, keep old
            _op = self.OP_GRAPH[_op].get(op, _op)
            self.pkey_ev_map[pk_data] = (_op, row)

            # skip update to pk-only table
            if len(pk_data) == len(row) and _op == 'U':
                del self.pkey_ev_map[pk_data]
        except KeyError:
            raise Exception('unknown event type: %s' % op)
def process ( self , op , row ) : pk_data = tuple ( row [ k ] for k in self . pkeys ) # get current op state, None if first event _op = self . pkey_ev_map . get ( pk_data , ( None , ) ) [ 0 ] # find new state and store together with row data try : # get new op state using op graph # when no edge defined for old -> new op, keep old _op = self . OP_GRAPH [ _op ] . get ( op , _op ) self . pkey_ev_map [ pk_data ] = ( _op , row ) # skip update to pk-only table if len ( pk_data ) == len ( row ) and _op == 'U' : del self . pkey_ev_map [ pk_data ] except KeyError : raise Exception ( 'unknown event type: %s' % op )