Hi I encountered a werid situation as follows:
1. I set my working space by using the code following code and then using UpdateCursor api:
import arcpy
from pprint import pprint
# Setting the default location for geoprocessing tool inputs and outputs.
arcpy.env.workspace = r"original_path\....gdb"
arcpy.env.overwriteOutput = True
merge_chinesefields = ["CHINESENAME","CHINESESTREETNAME"]
with arcpy.da.UpdateCursor("test", merge_chinesefields) as cursor:
for row in cursor:
print (row)
2. I closed ArcGIS Pro and changed my whole working folder from "original_path\....gdb" to a new place as "new_path\....gdb"
3. I reopened the ArcGIS Project file from the new folder and then re-runed the exactly same code as above without changing the workspace. Therefore, in this time the code was still
arcpy.env.workspace = r"original_path\....gdb"
4. The werid thing is that although I did not change the workspace path, the code still worked and succesfully printed each row of the table. The code did not report error like:
Input Workspace: Dataset original_path\....gdb does not exist or is not supported
5. It seemed that the notebook can memory previous results and recall the previous results without noticing path change. Therefore, I tried the command of "arcpy.management.ClearWorkspaceCache()" as well as the process "Options - Display - Clear Cache Now". But the kernel can still run without errors and return the previous print result to me.
Did anyone encounter the same problem before? Is it because ArcGIS Pro somehow automatically generate a connection to my folder whereever it is stored in my computer?