data_storage.py 436 B

12345678910
  1. from fate_flow.entity.types import ExternalStorage
  2. from fate_flow.external.storage import MysqlStorage
  3. def save_data_to_external_storage(storage_engine, address, storage_table):
  4. if storage_engine.upper() in {ExternalStorage.MYSQL.value}:
  5. with MysqlStorage(address=address, storage_table=storage_table) as storage:
  6. storage.save()
  7. else:
  8. raise ValueError(f"{storage_engine.upper()} is not supported")