Skip to content

Commit

Permalink
disable ModelVersion (#1708)
Browse files Browse the repository at this point in the history
Co-authored-by: Szymon Sadkowski <[email protected]>
  • Loading branch information
2 people authored and Raalsky committed Mar 25, 2024
1 parent 2794755 commit d72de10
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- ?
Expand Down
4 changes: 4 additions & 0 deletions src/neptune/objects/model_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
NeedExistingModelVersionForReadOnlyMode,
NeptuneMissingRequiredInitParameter,
NeptuneOfflineModeChangeStageException,
NeptuneUnsupportedFunctionalityException,
)
from neptune.internal.backends.api_model import ApiExperiment
from neptune.internal.container_type import ContainerType
Expand Down Expand Up @@ -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)))
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/standard/test_stage_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
)
],
Expand Down Expand Up @@ -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
),
)
],
Expand All @@ -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
),
)
],
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/neptune/new/client/test_model_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import os
import unittest

import pytest
from mock import patch

from neptune import (
Expand All @@ -29,6 +30,7 @@
)
from neptune.exceptions import (
NeptuneOfflineModeChangeStageException,
NeptuneUnsupportedFunctionalityException,
NeptuneWrongInitParametersException,
)
from neptune.internal.backends.api_model import (
Expand All @@ -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: (
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d72de10

Please sign in to comment.