From 974da0ebf3e8b4e8cb162237262163ef85dffdfe Mon Sep 17 00:00:00 2001 From: Felipe Alex Hofmann Date: Tue, 7 Jan 2025 15:27:04 -0800 Subject: [PATCH] Speed up SDV-Enterprise integration tests (#2331) --- sdv/errors.py | 3 --- sdv/logging/utils.py | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdv/errors.py b/sdv/errors.py index c9906757c..8990f5748 100644 --- a/sdv/errors.py +++ b/sdv/errors.py @@ -73,9 +73,6 @@ class SDVVersionWarning(UserWarning): synthesizer and the current version of the SDV software. """ - def __init__(self, *args, **kwargs): - self.__class__.__name__ = 'SDV Version Warning' - class VersionError(ValueError): """Raised when loading a synthesizer from a newer version into an older one.""" diff --git a/sdv/logging/utils.py b/sdv/logging/utils.py index 97ff09fb0..cbe806152 100644 --- a/sdv/logging/utils.py +++ b/sdv/logging/utils.py @@ -3,6 +3,7 @@ import contextlib import logging import shutil +import tempfile from pathlib import Path import pandas as pd @@ -19,7 +20,9 @@ def get_sdv_logger_config(): if (store_path / 'sdv_logger_config.yml').exists(): config_path = store_path / 'sdv_logger_config.yml' else: - shutil.copyfile(config_path, store_path / 'sdv_logger_config.yml') + tmp_path = tempfile.mktemp(dir=store_path, suffix='.yml') + shutil.copyfile(config_path, tmp_path) + shutil.move(tmp_path, store_path / 'sdv_logger_config.yml') with open(config_path, 'r') as f: logger_conf = yaml.safe_load(f)