Possible Bug with arcpy.mapping.Layer at 10.3

3197
5
12-03-2015 07:19 AM
by Anonymous User
Not applicable

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

Tags (2)
0 Kudos
5 Replies
RebeccaStrauch__GISP
MVP Emeritus

Not answering your question specifically....but you can check out Python addin for data inventory and “broken-link” repair. to see how I handled some of the datasource updates. 

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
FreddieGibson
Occasional Contributor III

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"?

FreddieGibson
Occasional Contributor III

Also, how did you add the geodatabase data to the map? Did you by any chance use IPropertySet in ArcObjects to connect to the workspace?

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos