Select to view content in your preferred language

Upgraded to ArcGIS Pro 3.3.0 from 3.2.2 - content.add() no longer has an 'overwrite' item property

134
0
a week ago
anonymous_geographer
Occasional Contributor

Hey everyone,

I'm currently running the minor-release-gauntlet with my Python scripts. I've upgraded to Pro 3.3.0 from Pro 3.2.2 in my testing environment and am executing my Python scripts to ensure I haven't missed anything with deprecations since Python jumped from 3.9 to 3.11.

I've come across one scenario where it does appear that a feature has been deprecated, and I'm hoping to get some advice and/or clarification on what I should use instead.

In this scenario, my script has been uploading a Vector Tile Package to our ArcGIS Online account for a couple of years without issue. I do this by initiating an AGOL session in Python, then proceeding with agol_session.content.add() to upload the VTPK. Code snippet here:

 

# Attempts to add the VTPK file to AGOL, with parameters set.
upload_result = agol_session.content.add(
                item_properties={"title": vtpk_name,
                                 "description": "Description Text",
                                 "snippet": "Snippet Text",
                                 "tags": "OurAgencyName",
                                 "overwrite": True},
                data=vtpk_path, owner="OwnerName")

 

 

The upload is successful in Pro 3.3.0, but I now receive this warning message:

anonymous_geographer_0-1718808850313.png

Attempting to re-run the script (and overwrite the previously uploaded VTPK) results in a new error:

anonymous_geographer_0-1718811952552.png


The error makes sense, since 'overwrite' parameter has been deprecated. However, I have been unable to find any details about this deprecation. Confusingly, the current item_properties documentation for content.add()  still show 'overwrite' as an option:

anonymous_geographer_0-1718823764626.png


The overwrite parameter would overwrite the file uploaded to AGOL if the name/file already existed. We liked that feature (sometimes we need to re-run the content.add() workflow more than once a day if a quick replacement is needed for the same VTPK). The naming convention of the VTPK upload has been YYYYMMDD_AgencyName_BasemapAffiliatedName. I could start including HHMMSS to help keep the duplication from occurring, but I'd rather just use a parameter that accomplishes an overwrite if a new one was created.

Any thoughts or recommendations? Thanks!

0 Kudos
0 Replies