diff --git a/setup.py b/setup.py index 89a3a997a..70d529c52 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ package_dir={"": "src"}, url="https://www.comet.com", project_urls=project_urls, - version="2.2.5", + version="2.2.6", zip_safe=False, license="MIT", ) diff --git a/src/comet_llm/config.py b/src/comet_llm/config.py index 56e30aef9..2052ba8aa 100644 --- a/src/comet_llm/config.py +++ b/src/comet_llm/config.py @@ -169,7 +169,10 @@ def init( kwargs = {key: value for key, value in kwargs.items() if value is not None} - comet_ml.init(**kwargs) + if hasattr(comet_ml, "login"): + comet_ml.login(**kwargs) + else: + comet_ml.init(**kwargs) # deprecated global _COMET_LLM_CONFIG # Recreate the Config object to re-read the config files diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index 58f5bd295..f44fe7558 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -22,7 +22,7 @@ def mock_config_dict(patch_module): def test_init__happyflow(mock_config_dict): with Scenario() as s: - s.comet_ml.init( + s.comet_ml.login( api_key="api-key", workspace="the-workspace", project_name="the-project" @@ -39,7 +39,7 @@ def test_init__happyflow(mock_config_dict): def test_init__not_set_arguments_not_passed_to_comet_ml_init(mock_config_dict): with Scenario() as s: - s.comet_ml.init(api_key="api-key") + s.comet_ml.login(api_key="api-key") # Config object is recreated to re-read the config files s.config_helper.create_config_instance() >> "new-config"