def do_empty(conn, table_name):    
  logging.info("Starting Empty for " + table_name + "..")

  # get table schema
  logging.info("Fetching table schema for " + table_name)
  table_data = conn.describe_table(table_name)

  table_desc = table_data["Table"]
  table_attribute_definitions = table_desc["AttributeDefinitions"]
  table_key_schema = table_desc["KeySchema"]
  original_read_capacity = table_desc["ProvisionedThroughput"]["ReadCapacityUnits"]
  original_write_capacity = table_desc["ProvisionedThroughput"]["WriteCapacityUnits"]
  table_local_secondary_indexes = table_desc.get("LocalSecondaryIndexes")
  table_global_secondary_indexes = table_desc.get("GlobalSecondaryIndexes")

  table_provisioned_throughput = {"ReadCapacityUnits": int(original_read_capacity), "WriteCapacityUnits": int(original_write_capacity)}

  logging.info("Deleting Table " + table_name)

  delete_table(conn, sleep_interval, table_name)

  logging.info("Creating Table " + table_name)

  while True:
      try:
        conn.create_table(table_attribute_definitions, table_name, table_key_schema, table_provisioned_throughput, table_local_secondary_indexes, table_global_secondary_indexes)
        break
      except boto.exception.JSONResponseError, e:
        if e.body["__type"] == "com.amazonaws.dynamodb.v20120810#LimitExceededException":
          logging.info("Limit exceeded, retrying creation of " + destination_table + "..")
          time.sleep(sleep_interval)
        elif e.body["__type"] == "com.amazon.coral.availability#ThrottlingException":
          logging.info("Control plane limit exceeded, retrying creation of " + destination_table + "..")
          time.sleep(sleep_interval)
        else:
          logging.exception(e)
          sys.exit(1)

  # wait for table creation completion
  wait_for_active_table(conn, table_name, "created")



  logging.info("Recreation of " + table_name + " completed. Time taken: " + str(start_time - datetime.datetime.now().replace(microsecond=0)))
dataset/ETHPy150Open bchew/dynamodump/dynamodump.py/do_empty/swapped operands of `-`