scout/adapter/mongo/variant_loader.py
def load_variant_bulk(self, variants):
        """Load a bulk of variants

        Args:
            variants(iterable(scout.models.Variant))

        Returns:
            object_ids
        """
        if not len(variants) > 0:
            return

        LOG.debug("Loading variant bulk")
        try:
            result = self.variant_collection.insert_many(variants)
        except (DuplicateKeyError, BulkWriteError) as err:
            # If the bulk write is wrong there are probably some variants already existing
            # In the database. So insert each variant
            for var_obj in variants:
                try:
                    self.upsert_variant(var_obj)
                except IntegrityError as err:
                    pass

        return
def load_variant_bulk(self, variants):
        if not len(variants) > 0:
            return

        LOG.debug("Loading variant bulk")
        try:
            result = self.variant_collection.insert_many(variants)
        except (DuplicateKeyError, BulkWriteError) as err:
            # If the bulk write is wrong there are probably some variants already existing
            # In the database. So insert each variant
            for var_obj in variants:
                try:
                    self.upsert_variant(var_obj)
                except IntegrityError as err:
                    pass

        return
def load_variant_bulk ( self , variants ) : if not len ( variants ) > 0 : return LOG . debug ( "Loading variant bulk" ) try : result = self . variant_collection . insert_many ( variants ) except ( DuplicateKeyError , BulkWriteError ) as err : # If the bulk write is wrong there are probably some variants already existing # In the database. So insert each variant for var_obj in variants : try : self . upsert_variant ( var_obj ) except IntegrityError as err : pass return
Load a bulk of variants

        Args:
            variants(iterable(scout.models.Variant))

        Returns:
            object_ids
Load a bulk of variants