Select to view content in your preferred language

Clone_items() No Longer Cloning Dashboards

70
1
Thursday
Labels (3)
JoeWaters
New Contributor II

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:

DashboardCloningError1.PNG

 

Any ideas as to why this is happening and/or potential work arounds?

0 Kudos
1 Reply
EarlMedina
Esri Regular Contributor

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)

 

 

0 Kudos