src/dirbs/importer/base_delta_importer.py
def _check_import_size_variation(self):
        """Check whether the import size has changed appropriately in the new import."""
        curr_row_count = self.row_count
        staging_row_count = self.staging_row_count
        # If there is nothing in the DB, allow anything
        metric_key = 'historic_import_size'
        if curr_row_count == 0:
            return 'import size', True, staging_row_count, curr_row_count, 0, metric_key

        # Never allow the new import to be more than specified absolute rows smaller than the existing row count
        # -1 is a special value for _import_size_variation_absolute variable.
        # If _import_size_variation_absolute is a positive integer (zero allowed), it will
        # check that specified absolute rows are bigger than the existing row count.
        # By setting this variable to neg one, this check will be disabled.
        if self._import_size_variation_absolute == -1:
            min_staging_row_count = 1
        else:
            min_staging_row_count = max(1, curr_row_count - self._import_size_variation_absolute)
        # Don't allow more than specified decrease percentage
        min_staging_row_count = max(min_staging_row_count, self._import_size_variation_percent * curr_row_count)
        check_result = staging_row_count >= min_staging_row_count
        return 'import size', check_result, staging_row_count, curr_row_count, min_staging_row_count, metric_key
Check whether the import size has changed appropriately in the new import.
Check whether the import size has changed appropriately in the new import.
Check whether the import size has changed appropriately in the new import .
def _check_import_size_variation(self):
        curr_row_count = self.row_count
        staging_row_count = self.staging_row_count
        metric_key = 'historic_import_size'
        if curr_row_count == 0:
            return 'import size', True, staging_row_count, curr_row_count, 0, metric_key
        if self._import_size_variation_absolute == -1:
            min_staging_row_count = 1
        else:
            min_staging_row_count = max(1, curr_row_count - self._import_size_variation_absolute)
        min_staging_row_count = max(min_staging_row_count, self._import_size_variation_percent * curr_row_count)
        check_result = staging_row_count >= min_staging_row_count
        return 'import size', check_result, staging_row_count, curr_row_count, min_staging_row_count, metric_key
def _check_import_size_variation ( self ) : curr_row_count = self . row_count staging_row_count = self . staging_row_count metric_key = 'historic_import_size' if curr_row_count == 0 : return 'import size' , True , staging_row_count , curr_row_count , 0 , metric_key if self . _import_size_variation_absolute == - 1 : min_staging_row_count = 1 else : min_staging_row_count = max ( 1 , curr_row_count - self . _import_size_variation_absolute ) min_staging_row_count = max ( min_staging_row_count , self . _import_size_variation_percent * curr_row_count ) check_result = staging_row_count >= min_staging_row_count return 'import size' , check_result , staging_row_count , curr_row_count , min_staging_row_count , metric_key
Check whether the import size has changed appropriately in the new import.
Check whether the import size has changed appropriately in the new import .
"""Check whether the import size has changed appropriately in the new import.""" # If there is nothing in the DB, allow anything # Never allow the new import to be more than specified absolute rows smaller than the existing row count # -1 is a special value for _import_size_variation_absolute variable. # If _import_size_variation_absolute is a positive integer (zero allowed), it will # check that specified absolute rows are bigger than the existing row count. # By setting this variable to neg one, this check will be disabled. # Don't allow more than specified decrease percentage
self