from datapackage_pipelines.wrapper import process


def process_row(row, row_index,
                spec, resource_index,
                parameters, stats):
    for f in spec['schema']['fields']:
        if 'factor' in f:
            factor = {
                '1m': 1000000
            }[f['factor']]
        v = row[f['name']]
        if v:
            row[f['name']] = v * factor
    return row


process(process_row=process_row)
from datapackage_pipelines.wrapper import process


def process_row(row, row_index,
                spec, resource_index,
                parameters, stats):
    for f in spec['schema']['fields']:
        if 'factor' in f:
            factor = {
                '1m': 1000000
            }[f['factor']]
            v = row[f['name']]
            if v:
                row[f['name']] = v * factor
    return row


process(process_row=process_row)
Fix bad indentation in processor
Fix bad indentation in processor

  from datapackage_pipelines.wrapper import process
  
  
  def process_row(row, row_index,
                  spec, resource_index,
                  parameters, stats):
      for f in spec['schema']['fields']:
          if 'factor' in f:
              factor = {
                  '1m': 1000000
              }[f['factor']]
-         v = row[f['name']]
+             v = row[f['name']]
-         if v:
+             if v:
-             row[f['name']] = v * factor
+                 row[f['name']] = v * factor
      return row
  
  
  process(process_row=process_row)
Fix bad indentation in processor
## Code Before:
from datapackage_pipelines.wrapper import process


def process_row(row, row_index,
                spec, resource_index,
                parameters, stats):
    for f in spec['schema']['fields']:
        if 'factor' in f:
            factor = {
                '1m': 1000000
            }[f['factor']]
        v = row[f['name']]
        if v:
            row[f['name']] = v * factor
    return row


process(process_row=process_row)
## Instruction:
Fix bad indentation in processor
## Code After:
from datapackage_pipelines.wrapper import process


def process_row(row, row_index,
                spec, resource_index,
                parameters, stats):
    for f in spec['schema']['fields']:
        if 'factor' in f:
            factor = {
                '1m': 1000000
            }[f['factor']]
            v = row[f['name']]
            if v:
                row[f['name']] = v * factor
    return row


process(process_row=process_row)