<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Possible Bug with arcpy.mapping.Layer at 10.3 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743537#M57469</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure if this is a bug or not, but could &lt;STRONG&gt;someone from Esri&lt;/STRONG&gt; please confirm that this is the expected behavior?&amp;nbsp; I am looping through several large mxd's and updating data sources if they aren't in SDE.&amp;nbsp; According to the &lt;A href="https://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/layer-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;help docs&lt;/A&gt;, only layers coming from SDE and web service layers should support the "SERVICEPROPERTIES" layer property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from the arcpy.mapping.Layer.supports():&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;SERVICEPROPERTIES —Connection information for SDE and web service layers&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, layers coming from File GDBs are returning True from the lyr.supports("SERVICEPROPERTIES"):&lt;IMG __jive_id="151206" alt="Capture.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/151206_Capture.PNG" style="width: 620px; height: 278px;" /&gt;&lt;/P&gt;&lt;P&gt;I may be losing my mind but this seems wrong to me.&amp;nbsp; 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.&amp;nbsp; So now I will use this as a workaround:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if lyr.supports("SERVICEPROPERTIES") and 'Dbclient' in lyr.serviceProperties:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # do something&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work, but it is clunky and seems very unnecessary.&amp;nbsp;&amp;nbsp; Can anyone shed some light on this? &lt;A href="https://community.esri.com/migrated-users/3200" target="_blank"&gt;Jeff Barrette&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:38:38 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T07:38:38Z</dc:date>
    <item>
      <title>Possible Bug with arcpy.mapping.Layer at 10.3</title>
      <link>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743537#M57469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure if this is a bug or not, but could &lt;STRONG&gt;someone from Esri&lt;/STRONG&gt; please confirm that this is the expected behavior?&amp;nbsp; I am looping through several large mxd's and updating data sources if they aren't in SDE.&amp;nbsp; According to the &lt;A href="https://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/layer-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;help docs&lt;/A&gt;, only layers coming from SDE and web service layers should support the "SERVICEPROPERTIES" layer property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from the arcpy.mapping.Layer.supports():&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;SERVICEPROPERTIES —Connection information for SDE and web service layers&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, layers coming from File GDBs are returning True from the lyr.supports("SERVICEPROPERTIES"):&lt;IMG __jive_id="151206" alt="Capture.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/151206_Capture.PNG" style="width: 620px; height: 278px;" /&gt;&lt;/P&gt;&lt;P&gt;I may be losing my mind but this seems wrong to me.&amp;nbsp; 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.&amp;nbsp; So now I will use this as a workaround:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if lyr.supports("SERVICEPROPERTIES") and 'Dbclient' in lyr.serviceProperties:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # do something&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work, but it is clunky and seems very unnecessary.&amp;nbsp;&amp;nbsp; Can anyone shed some light on this? &lt;A href="https://community.esri.com/migrated-users/3200" target="_blank"&gt;Jeff Barrette&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743537#M57469</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T07:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Possible Bug with arcpy.mapping.Layer at 10.3</title>
      <link>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743538#M57470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not answering your question specifically....but you can check out &lt;A href="https://community.esri.com/migration-blogpost/55043"&gt;Python addin for data inventory and “broken-link” repair.&lt;/A&gt; to see how I handled some of the datasource updates.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 16:41:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743538#M57470</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-12-03T16:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Possible Bug with arcpy.mapping.Layer at 10.3</title>
      <link>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743539#M57471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 17:15:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743539#M57471</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-12-03T17:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Possible Bug with arcpy.mapping.Layer at 10.3</title>
      <link>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743540#M57472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 17:17:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743540#M57472</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-12-03T17:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Possible Bug with arcpy.mapping.Layer at 10.3</title>
      <link>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743541#M57473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but I am not having any issues updating the data sources.&amp;nbsp; I just noticed that this behavior seemed wrong.&amp;nbsp; I just wanted to see if this was a bug and looks like Freddie says it could be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 20:19:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743541#M57473</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-12-03T20:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Possible Bug with arcpy.mapping.Layer at 10.3</title>
      <link>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743542#M57474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am indeed using ArcGIS 10.3.0.&amp;nbsp; 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.&amp;nbsp; These were added normally to the TOC using Catalog or the Add Data button.&amp;nbsp; I can reproduce this using any File Geodatabase feature class in ArcMap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 20:26:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-bug-with-arcpy-mapping-layer-at-10-3/m-p/743542#M57474</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-12-03T20:26:43Z</dc:date>
    </item>
  </channel>
</rss>

