docstr: Re encrypts all columns in a Row
  :param row: Current row to reencrypt
  :param columns: Meta info from columns
docstr_tok: ["Re","encrypts","all","columns","in","a","Row",":","param","row",":","Current","row","to","reencrypt",":","param","columns",":","Meta","info","from","columns"]
code: def _re_encrypt_row(
      self,
      conn: Connection,
      row: Row,
      table_name: str,
      columns: dict[str, EncryptedType],
  ) -> None:
      """
      Re encrypts all columns in a Row
      :param row: Current row to reencrypt
      :param columns: Meta info from columns
      """
      re_encrypted_columns = {}
  
      for column_name, encrypted_type in columns.items():
          previous_encrypted_type = EncryptedType(
              type_in=encrypted_type.underlying_type,
              key=self._previous_secret_key,
          )
          try:
              unencrypted_value = (
                  previous_encrypted_type.process_result_value(
                      self._read_bytes(column_name, row[column_name]),
                      self._dialect,
                  )
              )
          except ValueError as ex:
              # Failed to unencrypt
              try:
                  encrypted_type.process_result_value(
                      self._read_bytes(column_name, row[column_name]),
                      self._dialect,
                  )
                  logger.info(
                      "Current secret is able to decrypt value on column [%s.%s],"
                      " nothing to do",
                      table_name,
                      column_name,
                  )
                  return
              except Exception:
                  raise Exception from ex  # pylint: disable=broad-exception-raised
  
          re_encrypted_columns[
              column_name
          ] = encrypted_type.process_bind_param(
              unencrypted_value,
              self._dialect,
          )
  
      set_cols = ",".join(
          [
              f"{name} = :{name}"
              for name in list(re_encrypted_columns.keys())
          ]
      )
      logger.info("Processing table: %s", table_name)
      conn.execute(
          text(f"UPDATE {table_name} SET {set_cols} WHERE id = :id"),
          id=row["id"],
          **re_encrypted_columns,
      )
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import Any, Optional
  from flask import Flask
  from flask_babel import lazy_gettext
  from sqlalchemy import text, TypeDecorator
  from sqlalchemy.engine import Connection, Dialect, Row
  from sqlalchemy_utils import EncryptedType
label_desc: Use image node_id 5 for calling the SecretsMigrator obj's underlying member method code with example usage: obj._re_encrypt_row(conn, row, table_name, columns) without return types