<?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 Re: A script that used to work before is now behaving strangely. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1608922#M74078</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/628304"&gt;@-_-&lt;/a&gt;&amp;nbsp;This is indeed a regression we discovered and fixed during 3.5 and will patch 3.4 with the next available patch.&amp;nbsp; What happened was new behavior was added into the the software called "alwaysUpdateClassLabels".&amp;nbsp; When you simply use the arcpy.mp API to update a class label, it got overwritten due to this new behavior.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')
active_map = aprx.activeMap
lyr = active_map.listLayers()[0]

sym = lyr.symbology
sym.renderer.classBreaks[0].label = "Testing 123"   #RESETS TO ORIG
lyr.symbology = sym&lt;/LI-CODE&gt;&lt;P&gt;But as you discovered, if the labels are modified via the CIM, it bypasses internal behavior and works.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')
active_map = aprx.activeMap
lyr = active_map.listLayers()[0]

lyr_cim = lyr.getDefinition('V3')
lyr_cim.renderer.breaks[0].label = "Testing 123"  #This works
lyr.setDefinition(lyr_cim)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This applies to all renderers and colorizers with class breaks.&amp;nbsp; Our apologies for the breaking change.&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp team&lt;/P&gt;</description>
    <pubDate>Thu, 24 Apr 2025 14:54:34 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2025-04-24T14:54:34Z</dc:date>
    <item>
      <title>A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607556#M74062</link>
      <description>&lt;P&gt;I was using a script to rewrite the graded color labels with Arcpy, but it stopped working (maybe after I updated to 3.4.3).&lt;BR /&gt;I simplified the code and tested it, and the labels were set for just a moment, but then they went back to normal.&lt;BR /&gt;Is there something wrong with this code?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

lyr="test"
tani="ha"

aprx=arcpy.mp.ArcGISProject("CURRENT")

view=aprx.activeView
mapname=view.map.name
maps=aprx.listMaps(mapname)[0]

l=maps.listLayers(lyr)[0]
label_count_last=l.symbology.renderer.breakCount

if hasattr(l.symbology, 'renderer'):
  if l.symbology.renderer.type == 'GraduatedColorsRenderer':
    sym = l.symbology
    sym.renderer.lowerBound = -10000000                 #3.4 lowerBound set on Renderer
    for i in range(0,label_count_last):
        brk=sym.renderer.classBreaks[i].upperBound
        sym.renderer.classBreaks[i].label=str(brk)+tani

    sym.renderer.classBreaks[-1].upperBound = 10000000 #upperBound set on upper ClassBreak
    l.symbology = sym&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When executed:&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6371738489112w236h190r48" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6371738489112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6371738489112w236h190r48');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6371738489112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 07:27:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607556#M74062</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2025-04-23T07:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607561#M74063</link>
      <description>&lt;P&gt;Do the classes stay in place is you drop the aprx.save()?&lt;/P&gt;&lt;P&gt;The code examples in the help use aprx.saveas or there is no saving.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 04:07:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607561#M74063</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-04-21T04:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607575#M74064</link>
      <description>&lt;P&gt;Removing aprx.save() doesn't change the result.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 07:24:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607575#M74064</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2025-04-21T07:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607600#M74065</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/graduatedcolorsrenderer-class.htm" target="_blank"&gt;GraduatedColorsRenderer—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which leaves the lower bound statement&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(Read and Write)&lt;BR /&gt;A double that represents the minimum value of the symbolized classificationField to be displayed.&lt;/P&gt;&lt;P&gt;Note:&lt;BR /&gt;The value of the lowerBound should only be set to a value within the range of the first class break, otherwise it will fail. The maximum value gets modified in the last class break by changing the upperBound property.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 10:40:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607600#M74065</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-04-21T10:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607850#M74069</link>
      <description>&lt;P&gt;OP, what version of Pro did you upgrade from when you jumped to 3.4.3?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 21:13:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607850#M74069</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2025-04-21T21:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607906#M74072</link>
      <description>&lt;P&gt;I think it was around 3.4.1.&lt;BR /&gt;However, when I upgraded to 3.4, various other problems occurred, so I can't clearly remember whether this problem was there at the time and I didn't notice it, or whether it started occurring when I upgraded to 3.4.3.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 02:16:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607906#M74072</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2025-04-22T02:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607907#M74073</link>
      <description>&lt;P&gt;The original code included code to set upper and lower limits, but this has now been removed in order to identify the cause.&lt;/P&gt;&lt;P&gt;Does this code work as intended in your environment?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 02:18:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607907#M74073</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2025-04-22T02:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607912#M74074</link>
      <description>&lt;P&gt;Unless this is you in the comment section of this &lt;A href="https://www.reddit.com/r/ArcGIS/comments/1h1iicw/why_arent_my_symbol_labels_updating_with_arcpy_in/" target="_blank" rel="noopener"&gt;Reddit post&lt;/A&gt;, you may not be the only one experiencing this issue recently. In my experience with minor releases (and given how much symbology-related stuff that &lt;A href="https://www.esri.com/content/dam/esrisites/en-us/media/products/arcgis-pro-issues-addressed/arcgis-pro-3-4-issues-addressed.pdf?srsltid=AfmBOorL8-9BateEpsvMkeJlJRO5rud32GCdQKBmLj0wElYU_kvETR_o" target="_blank" rel="noopener"&gt;Esri touched&lt;/A&gt; with the 3.4 release), I wouldn't rule out a bug being introduced. No mention of deprecations related to your issue in the release notes either. I use aprx.save() with my symbology updates as well, but haven't been doing the same workflows that you are doing.&amp;nbsp; It does look like you are running the code while Pro is open though. Do the edits save correctly if you run the script as a standalone while Pro is closed? That test might help you rule out a lock or read-only issue...maybe. Oh, and be sure to save a copy of your project beforehand if you try anything as a standalone. I learned that lesson the hard way. Ha.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 05:14:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1607912#M74074</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2025-04-22T05:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1608339#M74076</link>
      <description>&lt;P&gt;Sorry, I've always used the scripts in the toolbox and don't know how to run them standalone.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 01:47:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1608339#M74076</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2025-04-23T01:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1608817#M74077</link>
      <description>&lt;P&gt;I still don't know why the original code was causing the problem, but I was able to use CIM access to rewrite the label.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

lyr="test"
tani="ha"

aprx=arcpy.mp.ArcGISProject("CURRENT")

view=aprx.activeView
mapname=view.map.name
maps=aprx.listMaps(mapname)[0]

l=maps.listLayers(lyr)[0]
label_count_last=l.symbology.renderer.breakCount

if hasattr(l.symbology, 'renderer'):
  if l.symbology.renderer.type == 'GraduatedColorsRenderer':

    l_cim=l.getDefinition('V3')
    l_cim.renderer.minimumBreak = -10000000

    for i in range(0,label_count_last):
        brk=l_cim.renderer.breaks[i].upperBound
        l_cim.renderer.breaks[i].label=str(brk)+tani

    l_cim.renderer.breaks[-1].upperBound = 10000000
    l.setDefinition(l_cim)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Apr 2025 07:29:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1608817#M74077</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2025-04-24T07:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1608922#M74078</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/628304"&gt;@-_-&lt;/a&gt;&amp;nbsp;This is indeed a regression we discovered and fixed during 3.5 and will patch 3.4 with the next available patch.&amp;nbsp; What happened was new behavior was added into the the software called "alwaysUpdateClassLabels".&amp;nbsp; When you simply use the arcpy.mp API to update a class label, it got overwritten due to this new behavior.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')
active_map = aprx.activeMap
lyr = active_map.listLayers()[0]

sym = lyr.symbology
sym.renderer.classBreaks[0].label = "Testing 123"   #RESETS TO ORIG
lyr.symbology = sym&lt;/LI-CODE&gt;&lt;P&gt;But as you discovered, if the labels are modified via the CIM, it bypasses internal behavior and works.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')
active_map = aprx.activeMap
lyr = active_map.listLayers()[0]

lyr_cim = lyr.getDefinition('V3')
lyr_cim.renderer.breaks[0].label = "Testing 123"  #This works
lyr.setDefinition(lyr_cim)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This applies to all renderers and colorizers with class breaks.&amp;nbsp; Our apologies for the breaking change.&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp team&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 14:54:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1608922#M74078</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2025-04-24T14:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1609139#M74079</link>
      <description>&lt;P&gt;I see.&lt;BR /&gt;The latest version of the Japanese version I use is 3.4.3, so I didn't realize that there was a 3.5 version. I'm sorry.&lt;BR /&gt;I feel relieved now that I know the cause. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2025 03:52:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1609139#M74079</guid>
      <dc:creator>-_-</dc:creator>
      <dc:date>2025-04-25T03:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: A script that used to work before is now behaving strangely.</title>
      <link>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1609224#M74082</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/628304"&gt;@-_-&lt;/a&gt;&amp;nbsp; Pro 3.5 is soon to be released but we will also patch Pro 3.4.&amp;nbsp; The next patch will be Pro 3.4.4.&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp team&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2025 13:57:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/a-script-that-used-to-work-before-is-now-behaving/m-p/1609224#M74082</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2025-04-25T13:57:44Z</dc:date>
    </item>
  </channel>
</rss>

