I have a simple cloning Notebook to clone items from one account to another. This has worked well for quite some time. Recently I noticed it will clone webmaps, hosted feature layers, and Survey123 forms, but will no longer clone Dashboards.
I am seeing this error:
TypeError: '>=' not supported between instances of 'str' and 'int'
After executing the clone_items() function:
#... connect to "source" and "target" AGOL accounts in prior steps
# Identify the item to clone
item = source.content.get("AGOL ITEM ID")
# Clone the item to the target account
cloned_items = target.content.clone_items(items=[item])
Here is a screenshot of the error message:
Any ideas as to why this is happening and/or potential work arounds?
Seems like there's a hiccup in the logic there at least for your case. Apparently, data["version"] is a string that needs to be parsed into an integer for that comparison to work.
The first thing you can do is log an issue here with a description of your problem pretty much exactly as you posted: Issues · Esri/arcgis-python-api · GitHub
Next, if you are comfortable doing a bit of troubleshooting you can create a test conda environment (so you don't mess up your production environment) and tweak the source to see if it fixes your problem.
You can try making this change in the indicated file at line 4563:
if data["version"]:
if int(data["version"]) >= 24:
webmap_ids = _DashboardDefinition._get_webmap_ids_v24(data)
Hello,
I am also unable to clone dashboards using the clone_items() method. I noticed this when running my script through portal notebooks which is using the API version 2.1.0.3, yet when I run the same script using API version 2.1.0.2 on my local machine, my script runs fine. Were there some significant changes in the 2.1.0.3 version that may be causing this? Am I missing any additional parameters? If possible, how could I revert my notebook server to use the 2.1.0.2 version of the API? I have attempted on newly created dashboards, existing ones, and dashboards that have been cloned from other environments and always get the following results:
You should be able to do something like this in the python command prompt installed with the software (with your environment active):
conda install <pkg>=<version>