<?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: .edit_features() says it succeeds, but doesn't actually update features in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-features-says-it-succeeds-but-doesn-t/m-p/1321977#M8954</link>
    <description>&lt;P&gt;I've seen this before - the error handling is not always the best. What I have done in the past to troubleshoot is run small batches through edit_features until I can find the culprit(s). I can't recall the specifics of what was wrong each time, but I'm pretty sure at least once it was that a float was being applied to an int field. I think other times they were strings that exceeded the max length. You say you're updating geometry - I don't believe I've encountered an issue with that yet, but if the update includes non-geometry fields then perhaps you can check the below:&lt;/P&gt;&lt;P&gt;For the first scenario, you may need to check your dtypes to ensure that they're compatible.&lt;/P&gt;&lt;P&gt;For the second scenario (which happened a lot more frequently), I used to have a helper function that found the max string length in a dataframe column and compared that to the field length of the Feature Layer field. If it exceeded the field length, then I would update the feature layer definition to increase the field length. If this isn't an option, you might be able to pare down the string causing the issue.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 00:47:57 GMT</pubDate>
    <dc:creator>EarlMedina</dc:creator>
    <dc:date>2023-08-24T00:47:57Z</dc:date>
    <item>
      <title>.edit_features() says it succeeds, but doesn't actually update features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-features-says-it-succeeds-but-doesn-t/m-p/1321922#M8952</link>
      <description>&lt;P&gt;I'm trying to run a notebook script in AGOL that checks and fixes features with null geometry. The results from edit_features( ) operation indicates success, but the updates never appear in the feature layer. Any idea why this might be?&amp;nbsp;&lt;/P&gt;&lt;P&gt;For parent features with null geometry, the script loops through related child features, unions their geometry, and replaces parent features' geometry with the unioned product.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import arcgis 
gis = GIS("home")

uas_fs_id = '09379d41ab3448549525914a4b08524a'
uas_fs = gis.content.get(uas_fs_id)

missions_layer = uas_fs.layers[0]
flights_layer = uas_fs.layers[1]

missions = missions_layer.query()

for mission in missions:
    if mission.geometry is None:
        mission_globalid= mission.get_value('globalid')
        
        flights = flights_layer.query(where="parentglobalid='{}'".format(mission_globalid))
        
        flights_geom = [flight.geometry for flight in flights]
        
        unioned = arcgis.geometry.functions.union(spatial_ref={'wkid': 4326, 'latestWkid': 4326}, geometries=flights_geom, gis=gis)
        
        mission.geometry = unioned
        
        result = missions_layer.edit_features(updates=[mission])
        
        print(result)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;results:&lt;/P&gt;&lt;PRE&gt;{'addResults': [], 'updateResults': [{'objectId': 1, 'uniqueId': 1, 'globalId': 'bcb70fa1-b009-4133-8f33-1a4d707274fe', 'success': True}], 'deleteResults': []}
{'addResults': [], 'updateResults': [{'objectId': 2, 'uniqueId': 2, 'globalId': 'd5067b60-7f2c-4ef8-8f6a-1c0afa9fae55', 'success': True}], 'deleteResults': []}
{'addResults': [], 'updateResults': [{'objectId': 3, 'uniqueId': 3, 'globalId': '260083d3-0834-4f31-81e5-fb7fca7d4aa7', 'success': True}], 'deleteResults': []}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It always says it succeeds, but never does anything. What gives?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 21:11:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-features-says-it-succeeds-but-doesn-t/m-p/1321922#M8952</guid>
      <dc:creator>NickNuebel</dc:creator>
      <dc:date>2023-08-23T21:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: .edit_features() says it succeeds, but doesn't actually update features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-features-says-it-succeeds-but-doesn-t/m-p/1321977#M8954</link>
      <description>&lt;P&gt;I've seen this before - the error handling is not always the best. What I have done in the past to troubleshoot is run small batches through edit_features until I can find the culprit(s). I can't recall the specifics of what was wrong each time, but I'm pretty sure at least once it was that a float was being applied to an int field. I think other times they were strings that exceeded the max length. You say you're updating geometry - I don't believe I've encountered an issue with that yet, but if the update includes non-geometry fields then perhaps you can check the below:&lt;/P&gt;&lt;P&gt;For the first scenario, you may need to check your dtypes to ensure that they're compatible.&lt;/P&gt;&lt;P&gt;For the second scenario (which happened a lot more frequently), I used to have a helper function that found the max string length in a dataframe column and compared that to the field length of the Feature Layer field. If it exceeded the field length, then I would update the feature layer definition to increase the field length. If this isn't an option, you might be able to pare down the string causing the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 00:47:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-features-says-it-succeeds-but-doesn-t/m-p/1321977#M8954</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2023-08-24T00:47:57Z</dc:date>
    </item>
  </channel>
</rss>

