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"):
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
Thanks, but I am not having any issues updating the data sources. I just noticed that this behavior seemed wrong. I just wanted to see if this was a bug and looks like Freddie says it could be.
Are you using 10.3.0? I can't reproduce this at 10.3.1. According to the documentation this would be classified as a bug.
As a side note, if you're just trying to avoid the sde layers have you tried checking if the layer supports "DATASOURCE" (online services won't support this) and if the layer.datasource contains ".sde"?
I am indeed using ArcGIS 10.3.0. And no, the maps were created by colleagues and they would not have used any ArcObjects to add/connect to the data sources in the mxd. These were added normally to the TOC using Catalog or the Add Data button. I can reproduce this using any File Geodatabase feature class in ArcMap.