diff --git a/CHANGELOG.md b/CHANGELOG.md index af796e442..0e0dae6f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Removed `neptune-client` ([#1699](https://github.com/neptune-ai/neptune-client/pull/1699)) - Deleted `neptune.logging` package ([#1698](https://github.com/neptune-ai/neptune-client/pull/1698)) - Disabled `Model` ([#1701](https://github.com/neptune-ai/neptune-client/pull/1701)) +- Disabled `ModelVersion` ([#1701](https://github.com/neptune-ai/neptune-client/pull/1708)) ### Features - ? diff --git a/src/neptune/objects/model_version.py b/src/neptune/objects/model_version.py index ff6467daa..a52462777 100644 --- a/src/neptune/objects/model_version.py +++ b/src/neptune/objects/model_version.py @@ -34,6 +34,7 @@ NeedExistingModelVersionForReadOnlyMode, NeptuneMissingRequiredInitParameter, NeptuneOfflineModeChangeStageException, + NeptuneUnsupportedFunctionalityException, ) from neptune.internal.backends.api_model import ApiExperiment from neptune.internal.container_type import ContainerType @@ -176,6 +177,9 @@ def __init__( async_no_progress_callback: Optional[NeptuneObjectCallback] = None, async_no_progress_threshold: float = ASYNC_NO_PROGRESS_THRESHOLD, ) -> None: + + raise NeptuneUnsupportedFunctionalityException + verify_type("with_id", with_id, (str, type(None))) verify_type("name", name, (str, type(None))) verify_type("model", model, (str, type(None))) diff --git a/tests/e2e/standard/test_stage_transitions.py b/tests/e2e/standard/test_stage_transitions.py index fd72d3487..4a191273c 100644 --- a/tests/e2e/standard/test_stage_transitions.py +++ b/tests/e2e/standard/test_stage_transitions.py @@ -30,7 +30,7 @@ class TestStageTransitions(BaseE2ETest): pytest.param( "model_version", marks=pytest.mark.xfail( - reason="Model not implemented", strict=True, raises=NeptuneUnsupportedFunctionalityException + reason="Model version not implemented", strict=True, raises=NeptuneUnsupportedFunctionalityException ), ) ], @@ -62,7 +62,7 @@ def test_transitions(self, container: ModelVersion): pytest.param( "model_version", marks=pytest.mark.xfail( - reason="Model not implemented", strict=True, raises=NeptuneUnsupportedFunctionalityException + reason="Model version not implemented", strict=True, raises=NeptuneUnsupportedFunctionalityException ), ) ], @@ -79,7 +79,7 @@ def test_fail_on_unknown_stage_value(self, container: ModelVersion): pytest.param( "model_version", marks=pytest.mark.xfail( - reason="Model not implemented", strict=True, raises=NeptuneUnsupportedFunctionalityException + reason="Model version not implemented", strict=True, raises=NeptuneUnsupportedFunctionalityException ), ) ], diff --git a/tests/unit/neptune/new/client/test_model_version.py b/tests/unit/neptune/new/client/test_model_version.py index bbf1dbbf2..9583dcadd 100644 --- a/tests/unit/neptune/new/client/test_model_version.py +++ b/tests/unit/neptune/new/client/test_model_version.py @@ -16,6 +16,7 @@ import os import unittest +import pytest from mock import patch from neptune import ( @@ -29,6 +30,7 @@ ) from neptune.exceptions import ( NeptuneOfflineModeChangeStageException, + NeptuneUnsupportedFunctionalityException, NeptuneWrongInitParametersException, ) from neptune.internal.backends.api_model import ( @@ -54,6 +56,7 @@ AN_API_MODEL_VERSION = api_model_version() +@pytest.mark.xfail(reason="Model version not supported", strict=True, raises=NeptuneUnsupportedFunctionalityException) @patch( "neptune.internal.backends.neptune_backend_mock.NeptuneBackendMock.get_metadata_container", new=lambda _, container_id, expected_container_type: ( @@ -71,6 +74,12 @@ def setUpClass(cls) -> None: os.environ[PROJECT_ENV_NAME] = "organization/project" os.environ[API_TOKEN_ENV_NAME] = ANONYMOUS_API_TOKEN + @pytest.mark.skip( + ( + "By coincidence, the test is passing when it should not. It's caused by the fact that " + "NeptuneUnsupportedFunctionalityException is subclass of NeptuneException" + ) + ) def test_offline_mode(self): with self.assertRaises(NeptuneException): init_model_version(model="PRO-MOD", mode="offline") @@ -139,6 +148,12 @@ def test_change_stage(self): with self.assertRaises(ValueError): exp.change_stage(stage="wrong_stage") + @pytest.mark.skip( + ( + "By coincidence, the test is passing when it should not. It's caused by the fact that " + "NeptuneUnsupportedFunctionalityException is subclass of NeptuneException" + ) + ) def test_change_stage_of_offline_model_version(self): # this test will be required when we decide that creating model versions # in offline mode is allowed