From a73cd11bb67513c5870c0c42e298696c709aec93 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kuzmik Date: Wed, 17 Jul 2024 12:10:13 +0200 Subject: [PATCH 1/3] Handle comet_ml.init deprecation --- src/comet_llm/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 7a25579ce635d81f22a132697613594d57207575 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kuzmik Date: Wed, 17 Jul 2024 12:11:29 +0200 Subject: [PATCH 2/3] Bumped version 2.2.6 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", ) From 67704641fc05b9a49209555dda58035abc8cda41 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kuzmik Date: Wed, 17 Jul 2024 12:18:22 +0200 Subject: [PATCH 3/3] Update tests --- tests/unit/test_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"