merge_machine/abstract_data_project.py
def valid_index(self):
        ''' Check that the number of rows in ES fits with nrows'''
        
        # Get file name (complicated due to legacy functionalities)
        file_names = [x for x in self.metadata['files'].keys() if MINI_PREFIX not in x]
        
        # TODO: very ugly hack to separate normalizer and link
        if ('ref' in file_names) and ('source' in file_names):
            return True
        
        assert len(file_names) == 1
        
        file_name = file_names[0]
        
        nrows = self.metadata['files'][file_name]['nrows']
        
        nrows_es = self.ic.stats(self.index_name, 'docs')['_all']['total']['docs']['count']
        
        if nrows != nrows_es:
            logging.error('ES index does not have the same number of rows as the original file.')
            return False
        return True
 Check that the number of rows in ES fits with nrows
Check that the number of rows in ES fits with nrows
Check that the number of rows in ES fits with nrows
def valid_index(self):
        file_names = [x for x in self.metadata['files'].keys() if MINI_PREFIX not in x]
        if ('ref' in file_names) and ('source' in file_names):
            return True
        assert len(file_names) == 1
        file_name = file_names[0]
        nrows = self.metadata['files'][file_name]['nrows']
        nrows_es = self.ic.stats(self.index_name, 'docs')['_all']['total']['docs']['count']
        if nrows != nrows_es:
            logging.error('ES index does not have the same number of rows as the original file.')
            return False
        return True
def valid_index ( self ) : file_names = [ x for x in self . metadata [ 'files' ] . keys ( ) if MINI_PREFIX not in x ] if ( 'ref' in file_names ) and ( 'source' in file_names ) : return True assert len ( file_names ) == 1 file_name = file_names [ 0 ] nrows = self . metadata [ 'files' ] [ file_name ] [ 'nrows' ] nrows_es = self . ic . stats ( self . index_name , 'docs' ) [ '_all' ] [ 'total' ] [ 'docs' ] [ 'count' ] if nrows != nrows_es : logging . error ( 'ES index does not have the same number of rows as the original file.' ) return False return True
Check that the number of rows in ES fits with nrows
Check that the number of rows in ES fits with nrows
''' Check that the number of rows in ES fits with nrows''' # Get file name (complicated due to legacy functionalities) # TODO: very ugly hack to separate normalizer and link
self