<?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: Branch Versioning Edit Error in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1184155#M7504</link>
    <description>&lt;P&gt;Hey, I just saw my notification for this, thanks for the feedback.&amp;nbsp; It seemed to be an issue with my Python environment, I cloned a new one and reinstalled the 2.0 API.&amp;nbsp; The edit call worked this time, but now I'm getting errors elsewhere (specifically on the stop editing call).&amp;nbsp; For now I've abandoned it and I'm using REST API and requests to do what I need.&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jun 2022 22:50:55 GMT</pubDate>
    <dc:creator>MobiusSnake</dc:creator>
    <dc:date>2022-06-18T22:50:55Z</dc:date>
    <item>
      <title>Branch Versioning Edit Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1179746#M7451</link>
      <description>&lt;P&gt;Hi all, I'm trying to use the v2.0.0 API for branch versioning and I'm hitting an unexpected issue.&amp;nbsp; I can create and open a version without any issues, but my edit() call against the version is failing.&amp;nbsp; I expect I'm passing in an incorrect object somewhere but haven't seen any samples using the edit() call.&lt;/P&gt;&lt;P&gt;Here's my current code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;versionName = f"test_ver"
qualVersionName = f"{GIS_USERNAME}.{versionName}"
createSuccess = versionManager.create(versionName)
with versionManager.get(qualVersionName, mode="edit") as version:
    featureLayer = version.layers[0]
    update = {"attributes": {"OBJECTID": 1, "TEST_ATTR": 1}}
    editResult = version.edit(featureLayer, updates=[update])&lt;/LI-CODE&gt;&lt;P&gt;When it hits the edit() call, I get this error from _connection.py, caught at line 1032:&lt;/P&gt;&lt;P&gt;'Multipart Encoder' object has no attribute 'decode'&lt;/P&gt;&lt;P&gt;I've tried not using the context manager with version, as well as explicitly making start_editing() calls and setting the mode property, get the same result regardless.&amp;nbsp; I've also tried passing in a feature layer object that I opened in the normal fashion rather than the one from the version, also the same result.&lt;/P&gt;&lt;P&gt;I've created the Python environment by cloning my ArcGIS Pro environment (with v1.9.1) and then using the command line to upgrade the Python API version (&lt;SPAN&gt;conda install -c esri arcgis=2.0.0)&lt;/SPAN&gt;.&amp;nbsp; There were no errors, I haven't seen anything to indicate there are any issues with the environment, and I've been able to make other API calls like queries, etc., without issue.&lt;/P&gt;&lt;P&gt;Let me know if you've run into anything like this, or if anything in my code looks unusual.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 09:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1179746#M7451</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2022-06-03T09:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Branch Versioning Edit Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1182521#M7487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115587"&gt;@MobiusSnake&lt;/a&gt;&amp;nbsp;- I tested this and the following formatting worked to edit a feature. Query&amp;nbsp;&lt;EM&gt;featureLayer&lt;/EM&gt; to return a list of features, and then create a feature template using a list comprehension to query the specific feature you want to edit. Then assign a new variable to the feature template, then edit the new variable's field you want to change and use that new variable as the argument for &lt;EM&gt;updates. &lt;/EM&gt;Try these lines after line 5:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;feat_list = featureLayer.query(where="1=1").features
feat_template = [f for f in feat_list if f.attributes["OBJECTID"] == 1][0]
feat_to_edit = feat_template
feat_to_edit.attributes["TEST_ATTR"] = 1
editResult = version.edit(featureLayer, updates=[feat_to_edit])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Give this a try and see if that updates&lt;EM&gt; featureLayer&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 23:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1182521#M7487</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-06-13T23:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Branch Versioning Edit Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1184155#M7504</link>
      <description>&lt;P&gt;Hey, I just saw my notification for this, thanks for the feedback.&amp;nbsp; It seemed to be an issue with my Python environment, I cloned a new one and reinstalled the 2.0 API.&amp;nbsp; The edit call worked this time, but now I'm getting errors elsewhere (specifically on the stop editing call).&amp;nbsp; For now I've abandoned it and I'm using REST API and requests to do what I need.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2022 22:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1184155#M7504</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2022-06-18T22:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Branch Versioning Edit Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1209828#M7713</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115587"&gt;@MobiusSnake&lt;/a&gt;&amp;nbsp;, I am also trying to implement reconcile and post the branch version using the same logic but throws error "&lt;STRONG&gt;Version already in edit mode. Only one user can be editing a branch version.&lt;/STRONG&gt;" Can you share some idea to implement the #ArcPy #BranchVersion #ReconcilePost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 12:56:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/branch-versioning-edit-error/m-p/1209828#M7713</guid>
      <dc:creator>SU00861536</dc:creator>
      <dc:date>2022-09-06T12:56:39Z</dc:date>
    </item>
  </channel>
</rss>

