Write code in Python (v3) for the implementation of the following algorithmic task; catch exceptions, create a unit test using Pytest: Connect to a MySQL database Select all the data from the table "Data" where column "Flag" value is set to true. Export it to a local file "exported.dat". Transform data stored in a local file, set the value of the column "StringA" to the uppercase value of the "StringB" with an appended suffix "_". Save to a local file "transformed.dat" Connect to a Redshift database, import data from "transformed.dat" to "Data" table
To install the module, use pip: pip install sync_file_Redshift