Under the section Get an existing datastore, there is a code snippet that looks like this:
datastores = ws.datastores()
for name, ds in datastores.items(),
print(name, ds.datastore_type)"
which raises syntax error due to the ending comma (,) in the second row (should be colon (:)) and also the trailing quotation mark (") on the third row.
But even if I correct this, I can't get the code to run. I only get the following error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-45-4c937c1deb4c> in <module>()
1 datastores = ws.datastores()
----> 2 for name, ds in datastores.items():
3 print(name, ds.datastore_type)
AttributeError: 'list' object has no attribute 'items'
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@arvidbaa thanks for the catch! Will update the code snippet
@mx-iao Thanks for the quick action!!
@ArvidBaa Thanks for reporting the issue. We will now proceed to close this thread. If there are further questions regarding this matter, please respond here and @YutongTie-MSFT and we will gladly continue the discussion.
Hi @ArvidBaa Once the typos are fixed, you should be able to run the code successfully. Please make sure you are using the latest version of the aml sdk. You should update to 0.1.65 if you havent: https://pypi.org/project/azureml-core/
Yes, after upgrading to the latest version, I can confirm that the code can be run successfully after the typos are fixed.
Thank you for your help!