diff --git a/examples/workspaces/01_loading_and_cloning_workspaces.py b/examples/workspaces/01_loading_and_cloning_workspaces.py index c47aa2e..92d05f5 100644 --- a/examples/workspaces/01_loading_and_cloning_workspaces.py +++ b/examples/workspaces/01_loading_and_cloning_workspaces.py @@ -7,7 +7,7 @@ project = os.getenv("WANDB_PROJECT") # 1. Load a workspace from URL -url = "https://wandb.ai/megatruong/workspace-api-demo2?nw=vnizqj6vq3" +url = "https://wandb.ai/megatruong/workspace-api-demo2?nw=puwusholo4x" workspace = ws.Workspace.from_url(url) # 2a. Edit the workspace and save to the same view diff --git a/tests/test_workspaces.py b/tests/test_workspaces.py index 450c3dc..16d940c 100644 --- a/tests/test_workspaces.py +++ b/tests/test_workspaces.py @@ -134,7 +134,7 @@ def test_filter_expr(expr, spec): def test_load_workspace_from_url(): - url = "https://wandb.ai/megatruong/workspace-api-demo?nw=vs71wsgdvrz" + url = "https://wandb.ai/megatruong/workspace-api-demo?nw=puwusholo4x" workspace = ws.Workspace.from_url(url) # noqa: F841 @@ -192,9 +192,9 @@ def test_validate_no_emoji(example, should_pass): "example, should_pass", [ ({}, False), # No version - ({"version": 4}, False), # Lower version - ({"version": 5}, True), # Expected version - ({"version": 6}, False), # Higher version + ({"section":{"version": 4}}, False), # Lower version + ({"section":{"version": 5}}, True), # Expected version + ({"section":{"version": 6}}, False), # Higher version ], ) def test_validate_spec_version(example, should_pass): diff --git a/wandb_workspaces/utils/validators.py b/wandb_workspaces/utils/validators.py index 94a647c..0690b4e 100644 --- a/wandb_workspaces/utils/validators.py +++ b/wandb_workspaces/utils/validators.py @@ -15,7 +15,8 @@ def validate_no_emoji(s: str) -> str: def validate_spec_version( spec: Dict[str, Any], *, expected_version: int ) -> Dict[str, Any]: - actual_version = spec.get("version", -1) + spec_section = spec.get("section", {}) + actual_version = spec_section.get("version", -1) if actual_version < expected_version: raise SpecVersionError( diff --git a/wandb_workspaces/workspaces/internal.py b/wandb_workspaces/workspaces/internal.py index f24d736..0680bce 100644 --- a/wandb_workspaces/workspaces/internal.py +++ b/wandb_workspaces/workspaces/internal.py @@ -21,7 +21,7 @@ ) from wandb_workspaces.utils.validators import validate_spec_version -CLIENT_SPEC_VERSION = -1 +CLIENT_SPEC_VERSION = 1 SPEC_VERSION_KEY = "version"