def to_pb_record_entry()

in datahub/models/record.py [0:0]


    def to_pb_record_entry(self):
        pb_record_entry = {
            'data': self.encode_pb_record_data()
        }
        if self._partition_key:
            pb_record_entry['partition_key'] = self._partition_key
        if self._hash_key:
            pb_record_entry['hash_key'] = self._hash_key
        if self._shard_id:
            pb_record_entry['shard_id'] = self._shard_id
        if self._attributes:
            pb_record_entry['attributes'] = {
                'attributes': [{
                    'key': k,
                    'value': v
                } for k, v in self._attributes.items()]
            }
        return pb_record_entry