I am using the following but I get no error but it doesn't update the "State" field.
I've tested this on a different field and it works. The only thing about the "State" field is that it has a domain.
Is there something different I have to do in order for this to update the "State" field?
Also, this is in Pro.
import arcpy, os,sys
## Works in file geodatabase
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r'C:\Temp\Sates.gdb'
StSele = "States"
StStates = 'Statefile'
sjpoints = "In_memory\sjpoints"
arcpy.SpatialJoin_analysis(StSele, StStates, sjpoints)
search_feats ={f[0] for f in arcpy.da.SearchCursor(sjpoints,"State_1")}
print(search_feats)
place_dict = {"AL": "Alabama", "Ala": "Alaska", "OR": "Oregen", "Cal": "California", "WA": "Wasington"}
#print(place_dict)
with arcpy.da.UpdateCursor(StSele, "State") as upd_cur:
for upd_row in upd_cur:
upd_row[0] = place_dict.get(upd_row[0], upd_row[0])
upd_cur.updateRow(upd_row)