def RunOpOnTable(client, table, op, callback):
  if options.options.hash_key and options.options.range_key:
    key = db_client.DBKey(eval(options.options.hash_key), eval(options.options.range_key))
  elif options.options.hash_key:
    key = db_client.DBKey(eval(options.options.hash_key), None)
  else:
    key = None

  def _OnOp(result):
    logging.info('%s: %s' % (table.name, repr(result)))
    callback()

  logging.info('executing %s on table %s' % (op, table.name))
  if op == 'create':
    client.CreateTable(table=table.name, hash_key_schema=table.hash_key_schema,
                       range_key_schema=table.range_key_schema,
                       read_units=table.read_units, write_units=table.write_units,
                       callback=_OnOp)
  elif op == 'describe':
    client.DescribeTable(table=table.name, callback=_OnOp)
  elif op == 'REALLY_DELETE_TABLE':
    client.DeleteTable(table=table.name, callback=_OnOp)
  elif op == 'get-item':
    client.GetItem(table=table.name, key=key, callback=_OnOp,
                   attributes=options.options.col_names)
  elif op == 'update-item':
    parser = AttrParser(table, raw=True)
    attrs = parser.Run(options.options.attributes)
    client.UpdateItem(table=table.name, key=key, callback=_OnOp,
                      attributes=attrs, return_values='ALL_NEW')
  elif op == 'delete-item':
    client.DeleteItem(table=table.name, key=key, callback=_OnOp,
                      return_values='ALL_OLD')
  elif op == 'delete-range':
    assert table.range_key_col, 'Table %s is not composite' % table.name
    DeleteRange(client, table, _OnOp)
  elif op == 'query':
    assert table.range_key_col, 'Table %s is not composite' % table.name
    QueryRange(client, table, _OnOp)
  elif op == 'scan':
    Scan(client, table, _OnOp)
  else:
    raise Exception('unrecognized op: %s; ignoring...' % op)
Test that search plugins are handled correctly.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/tools/raw_dba.py/RunOpOnTable--crossover with--dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/tests/test_utils.py/TestValidationAnnotatorListed.test_search_plugin