I can't seem to find any reference to this in help or forums, but it seems a da cursor cannot apply a where clause to a layer with a where clause already applied. Does anyone know if this is this working as intended behaviour or a bug?
Here is some test code where this occurred.
This code returned
Here is some test code where this occurred.
Code:
import arcpy
data = r'D:\GIS\DataBase\misc.gdb\CLI_N'
lyr = 'temp'
arcpy.MakeFeatureLayer_management(data, lyr, 'OBJECTID < 100')
print(arcpy.GetCount_management(lyr))
count = 0
cursor = arcpy.da.SearchCursor(lyr, 'OBJECTID', 'OBJECTID < 10')
for _ in cursor:
count += 1
print(count)
Code:
>>>
99
99