Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up SDV-Enterprise integration tests #2331

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions sdv/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
5 changes: 4 additions & 1 deletion sdv/logging/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import contextlib
import logging
import shutil
import tempfile
from pathlib import Path

import pandas as pd
Expand All @@ -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')
Comment on lines +23 to +25
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is required because multiple workers can access the logger at the same time ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this function can be called simultaneously by multiple workers, so while one of them was copying config_path into store_path, another one was resetting the store_path/config_path variables.


with open(config_path, 'r') as f:
logger_conf = yaml.safe_load(f)
Expand Down
Loading