AnsweredAssumed Answered

Possible Bug with arcpy.mapping.Layer at 10.3

Question asked by Caleb1987 on Dec 3, 2015
Latest reply on Dec 3, 2015 by Caleb1987

I'm not sure if this is a bug or not, but could someone from Esri please confirm that this is the expected behavior?  I am looping through several large mxd's and updating data sources if they aren't in SDE.  According to the help docs, only layers coming from SDE and web service layers should support the "SERVICEPROPERTIES" layer property.

 

from the arcpy.mapping.Layer.supports():

SERVICEPROPERTIES —Connection information for SDE and web service layers

However, layers coming from File GDBs are returning True from the lyr.supports("SERVICEPROPERTIES"):Capture.PNG

I may be losing my mind but this seems wrong to me.  As you can see in the screenshot above, it even says "SDE" for the "ServiceType" for the file GDB layer. I know I have used this in past versions and I believe it would return False for anything not in SDE or coming from a web service.  So now I will use this as a workaround:

 

if lyr.supports("SERVICEPROPERTIES") and 'Dbclient' in lyr.serviceProperties:
    # do something

 

This will work, but it is clunky and seems very unnecessary.   Can anyone shed some light on this? Jeff Barrette

Outcomes