[massive store] Drop useless check for empty buffer
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 11 Oct 2016 10:24:13 +0200
changeset 11788 8e1fb9445d75
parent 11787 05b3e44c135f
child 11789 71df2811b422
[massive store] Drop useless check for empty buffer If something went wrong, an error will be raised.
cubicweb/dataimport/massive_store.py
--- a/cubicweb/dataimport/massive_store.py	Tue Oct 11 10:23:44 2016 +0200
+++ b/cubicweb/dataimport/massive_store.py	Tue Oct 11 10:24:13 2016 +0200
@@ -282,9 +282,6 @@
                 # There is no data for these etype for this flush round.
                 continue
             buf = pgstore._create_copyfrom_buffer(data, ('eid_from', 'eid_to'))
-            if not buf:
-                # The buffer is empty. This is probably due to error in _create_copyfrom_buffer
-                raise ValueError
             cursor = self._cnx.cnxset.cu
             tablename = '%s_relation' % rtype.lower()
             tmp_tablename = '%s_%s' % (tablename, self.uuid)
@@ -316,9 +313,6 @@
                 metagen.init_entity_attrs(etype, _d['eid'], _d)
                 _data.append(_d)
             buf = pgstore._create_copyfrom_buffer(_data, columns)
-            if not buf:
-                # The buffer is empty. This is probably due to error in _create_copyfrom_buffer
-                raise ValueError('Error in buffer creation for etype %s' % etype)
             columns = ['cw_%s' % attr for attr in columns]
             cursor = self._cnx.cnxset.cu
             try: