Skip to content

Commit 1e210b7

Browse files
Hannah14295hrehard
andauthored
fix(examples): correct ai_registry_example CRUD ordering and versions print (#6043)
Two issues made v3-examples/model-customization-examples/ai_registry_example.ipynb fail when run top to bottom: 1. `pprint(versions.__dict__)` raised `AttributeError: 'list' object has no attribute '__dict__'` because DataSet.get_versions() returns a list (List[DataSet]). Changed to `pprint(versions)`, matching the other get_versions cells in the same notebook. 2. The "delete specific version" and "delete all versions" cells ran in the middle of the DataSet section, deleting the `sdkv3-gen-ds2` dataset before the later "Use a dataset by name" (DataSet.get) and create_version cells, which then failed with ResourceNotFound. Moved both delete cells to the end of the DataSet section so the read/versioning demos run against the live dataset and cleanup happens last. Co-authored-by: hrehard <hrehard@amazon.com>
1 parent fe4b745 commit 1e210b7

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

‎v3-examples/model-customization-examples/ai_registry_example.ipynb‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,32 +90,7 @@
9090
"outputs": [],
9191
"source": [
9292
"versions = dataset.get_versions()\n",
93-
"pprint(versions.__dict__)"
94-
]
95-
},
96-
{
97-
"cell_type": "code",
98-
"execution_count": null,
99-
"id": "332be046d91fcefc",
100-
"metadata": {},
101-
"outputs": [],
102-
"source": [
103-
"# delete specific version\n",
104-
"dataset.delete(version=\"0.0.4\")\n",
105-
"#dataset.delete(version=\"use a version from versions\")\n",
106-
"#pprint(versions)\n",
107-
"# specified deleted version should not be part of output"
108-
]
109-
},
110-
{
111-
"cell_type": "code",
112-
"execution_count": null,
113-
"id": "510d1a015e7a565c",
114-
"metadata": {},
115-
"outputs": [],
116-
"source": [
117-
"# deletes all versions of this dataset by default\n",
118-
"dataset.delete()"
93+
"pprint(versions)"
11994
]
12095
},
12196
{
@@ -197,6 +172,31 @@
197172
"pprint(versions)"
198173
]
199174
},
175+
{
176+
"cell_type": "code",
177+
"execution_count": null,
178+
"id": "332be046d91fcefc",
179+
"metadata": {},
180+
"outputs": [],
181+
"source": [
182+
"# delete specific version\n",
183+
"dataset.delete(version=\"0.0.4\")\n",
184+
"#dataset.delete(version=\"use a version from versions\")\n",
185+
"#pprint(versions)\n",
186+
"# specified deleted version should not be part of output"
187+
]
188+
},
189+
{
190+
"cell_type": "code",
191+
"execution_count": null,
192+
"id": "510d1a015e7a565c",
193+
"metadata": {},
194+
"outputs": [],
195+
"source": [
196+
"# deletes all versions of this dataset by default\n",
197+
"dataset.delete()"
198+
]
199+
},
200200
{
201201
"cell_type": "markdown",
202202
"id": "a73d88d38a2d5ba3",

0 commit comments

Comments
 (0)