I'll keep it simple. Every time I run arcpy.da.UpdateCursor() either via the Python console, a Notebook or with a Python script to update an attribute table, the entire feature layer disappears from the map. Additionally, other feature layers disappear from the map (still present Table of Contents).
with arcpy.da.UpdateCursor('feat_in_TOC', ['fld_name']) as cursor:
for r in cursor:
new_val = '{}_new'.format(r[0])
r[0] = new_val
cursor.updateRow(r)
del cursorAfter running (successfully!) the feature layer has disappeared from the map. To fix this, I have to go to Recalculate the Index via the feature Properties --> Indexes --> Spatial Index dropdown --> Recalculate. The feature layer returns.
Note that the code sample has been run with different variations, field types, etc. - always same result. Just a simple example.
Note that this has been occurring since version 2.<8 and 9> ( https://community.esri.com/t5/forums/postpage/board-id/arcgis-pro-questions ), so it's not a version thing.
What is going on?
thanks,
Zach
Pro 3.02