<?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: Editor class documentation appears to be incorrect in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333749#M68783</link>
    <description>&lt;P&gt;The full error is:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "D:\scheduled_tasks\ProjectFolder\WCO_dataPull_editTest.py", line 41, in CreateOperatorDatabase&lt;BR /&gt;with arcpy.da.Editor(os.path.dirname(gisweb_wco), multiuser_mode=True):&lt;BR /&gt;TypeError: function takes at most 1 argument (2 given)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The full Traceback for the original error is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "D:\scheduled_tasks\WildlifeControlOperators\WCO_dataPull.py", line 111, in CreateOperatorDatabase&lt;BR /&gt;arcpy.management.DeleteFeatures(gisweb_wco)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4241, in DeleteFeatures&lt;BR /&gt;raise e&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4238, in DeleteFeatures&lt;BR /&gt;retval = convertArcObjectToPythonObject(gp.DeleteFeatures_management(*gp_fixargs((in_features,), True)))&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: ERROR 160250: Objects in this class cannot be updated outside an edit session&lt;BR /&gt;Failed to execute (DeleteFeatures).&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 14:23:33 GMT</pubDate>
    <dc:creator>FranklinAlexander</dc:creator>
    <dc:date>2023-09-29T14:23:33Z</dc:date>
    <item>
      <title>Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333739#M68781</link>
      <description>&lt;P&gt;I am trying to Delete, then Append data to a feature class in a versioned Enterprise GDB using a Python script (which is scheduled). I have run this same script before without issue and have other scripts running to update datasets on the same GDB that run without issue as well. I noticed that one of my scripts failed with the Error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 160250: Objects in this class cannot be updated outside an edit session&lt;BR /&gt;Failed to execute (DeleteFeatures).&lt;/P&gt;&lt;P&gt;Not sure if the is due to a setting that was changed on the feature class (which I do not administer and have no control over), but in response the the error, I tried to use the Editor class and start an editing session on the feature class before trying to Delete the records. Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Environment settings and global variables print ("Setting workspace and defining global variables\n") 
workFolder = r"\\server\\Scheduled_Tasks\\ProjectFolder"
logging.info("Setting workspace and defining global variables\n") 
TempDB = "Temp.gdb" 
TempWS = os.path.join(workFolder, TempDB) 
gis_sde = '\\\\tasksFolder\\DB_connections\\gis_gdb.sde' 
GISDB = os.path.join(gis_sde, "gis_gdb.Feature_dataset") 

def CreateOperatorDatabase(): 
  try:  

  WCO_merc = os.path.join(TempWS, "WCO_merc") 
  gisweb_wco = os.path.join(GISDB, "gis_gdb.point_featureClass") 
  with arcpy.da.Editor(os.path.dirname(gisweb_wco), multiuser_mode=True): 
    arcpy.management.DeleteFeatures(gisweb_wco) 
    arcpy.management.Append(WCO_merc, gisweb_wco, "NO_TEST","","") 
 
  except: print("Failed to process trapper data\n") logging.exception("Failed 
  to process trapper data\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code I get the error "TypeError: function takes at most 1 argument (2 given)"&lt;/P&gt;&lt;P&gt;Now I am confused because in the documentation it clearly states that the Editor class takes one required argument and one optional argument (and both are needed if editing in a versioned Enterprise GDB).&lt;/P&gt;&lt;P&gt;Documentation:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.html" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.html&lt;/A&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;STRONG&gt;Editor (workspace, {multiuser_mode})&lt;/STRONG&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;TABLE width="778px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="129.172px"&gt;Parameter&lt;/TD&gt;&lt;TD width="569.844px"&gt;Explanation&lt;/TD&gt;&lt;TD width="77.9844px"&gt;Data Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="129.172px"&gt;&lt;DIV class=""&gt;workspace&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="569.844px"&gt;&lt;P&gt;Path to the workspace to edit. The editor can edit only one workspace at a time.&lt;/P&gt;&lt;/TD&gt;&lt;TD width="77.9844px"&gt;String&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="129.172px"&gt;&lt;DIV class=""&gt;multiuser_mode&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="569.844px"&gt;&lt;P&gt;When edits will be performed on versioned data, set this to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;True&lt;/SPAN&gt;; otherwise, set it to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;False&lt;/SPAN&gt;. Only use with enterprise geodatabases.&lt;/P&gt;&lt;P&gt;(The default value is True)&lt;/P&gt;&lt;/TD&gt;&lt;TD width="77.9844px"&gt;Boolean&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example from doc:&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;new_students = 'C:/projects/Portland/Portland.sde/ptld.main.students_new2022'
students = 'C:/projects/Portland/Portland.sde/ptld.main.students'

# Start an edit session. Provide the workspace being acted on
# and with sde specify if data is edited in multiuser_mode.
with arcpy.da.Editor(os.path.dirname(students), multiuser_mode=True):

    # If all 3 edit operations run successfully without error
    # upon exiting this code block the edits will be applied to the data

    arcpy.management.CalculateField(new_students , 'arrived', '2022')
    arcpy.management.Append(new_students, students)
    arcpy.management.CalculateField(students, "active", True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can any one tell me what I am missing?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 13:59:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333739#M68781</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2023-09-29T13:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333743#M68782</link>
      <description>&lt;P&gt;What is the full traceback of the error?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 14:05:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333743#M68782</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2023-09-29T14:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333749#M68783</link>
      <description>&lt;P&gt;The full error is:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "D:\scheduled_tasks\ProjectFolder\WCO_dataPull_editTest.py", line 41, in CreateOperatorDatabase&lt;BR /&gt;with arcpy.da.Editor(os.path.dirname(gisweb_wco), multiuser_mode=True):&lt;BR /&gt;TypeError: function takes at most 1 argument (2 given)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The full Traceback for the original error is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "D:\scheduled_tasks\WildlifeControlOperators\WCO_dataPull.py", line 111, in CreateOperatorDatabase&lt;BR /&gt;arcpy.management.DeleteFeatures(gisweb_wco)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4241, in DeleteFeatures&lt;BR /&gt;raise e&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4238, in DeleteFeatures&lt;BR /&gt;retval = convertArcObjectToPythonObject(gp.DeleteFeatures_management(*gp_fixargs((in_features,), True)))&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: ERROR 160250: Objects in this class cannot be updated outside an edit session&lt;BR /&gt;Failed to execute (DeleteFeatures).&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 14:23:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333749#M68783</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2023-09-29T14:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333812#M68785</link>
      <description>&lt;P&gt;What version of ArcGIS Pro are you using? Looks like the 2.9 version does not have support for the&amp;nbsp;multiuser_mode parameter.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/2.9/arcpy/data-access/editor.htm" target="_blank"&gt;Editor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 17:02:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333812#M68785</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2023-09-29T17:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333835#M68786</link>
      <description>&lt;P&gt;That could be the issue. The server that I need to run the script from currently has 2.9.3 installed. Thanks for catching that, most of our servers have been updated to 3x so I just assumed that this server had been updated as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 17:55:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333835#M68786</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2023-09-29T17:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333869#M68788</link>
      <description>&lt;P&gt;I ran the script from another server that has version 3.1.2 installed and although I am not getting the 'argument' error any more, I do still get the '...outside an edit session' error. I am fairly certain that this is not an issue with the script, but an admin issue with the .sde or maybe the feature dataset that contains the FC. I notified the database administrator of the issue and if they can't fix it on their end I'll just open a ticket.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 19:19:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1333869#M68788</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2023-09-29T19:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1334091#M68800</link>
      <description>&lt;P&gt;Just a quick follow up, but I have confirmed it's not a script issue because the Delete tool doesn't run from ArcPro on the dataset either. My DB Administrator mentioned that is seems the issue was first documented after the ArcPro 3.0 update which makes me think it is a bug. I don't think this is a 'Editing' issue at all (hence the error shouldn't be taken at face value), but probably more of an 'access' problem. I will post if we find a solution, but would be interested if any one else has encountered a similar issue.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 12:10:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1334091#M68800</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2023-10-02T12:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Editor class documentation appears to be incorrect</title>
      <link>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1398408#M70092</link>
      <description>&lt;P&gt;I was encountering the same issue, although not with &lt;SPAN&gt;in a versioned Enterprise GDB, but in a local FGDB. In the end I realized that it was a licensing issue: I was testing with a basic account on a database created with the standard account containing relationships.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 13:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editor-class-documentation-appears-to-be-incorrect/m-p/1398408#M70092</guid>
      <dc:creator>CSDING_GIS</dc:creator>
      <dc:date>2024-03-20T13:56:16Z</dc:date>
    </item>
  </channel>
</rss>

