I am using a notebook in ArcGIS Online to overwrite a feature layer (with code excerpt below) and a couple things are not happening as expected:
1. None of the item properties are updating through the overwrite - is this expected? It did work the first time when initially creating the feature layer via the same to_featurelayer method (and overwrite=False).
#define feature layer properties
item_properties = {"service_name" : "Sample Stations test", #this only gets added the first time service is published. Needs to be unique.
"title" : "Sample Title",
"tags": "tagone, tagtwo",
"folder" : 'Script Outputs',
} #none of these are updating in overwrite
#publish sdf to feature layer
lyr = sdf.spatial.to_featurelayer(
title=item_properties["title"],
gis=gis,
tags=item_properties["tags"],
folder=item_properties["folder"],
#only when creating feature layer:
#service_name=item_properties["service_name"],
#only for overwrite:
overwrite=True,
service={"featureServiceId" : "ITEMID", "layer": 0})
item_id = lyr.id
url = lyr.url
print(f"Feature layer item {item_id} updated: ", url)
2. The overwrite itself is working although I do get the following warning message. How can I avoid this warning? And is it related to the item properties not updating?
Warning 6: dataset /tmp/tmp6a5ebhyr/ae9b78.gdb does not support layer creation option TARGET_ARCGIS_VERSION"
Would appreciate any suggestions! Thanks.