<?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: Overwrite not working, wrong number of records returned in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868824#M4564</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/265243"&gt;Treg&amp;nbsp;&lt;/A&gt;&amp;nbsp;- I'm seeing the same problem you documented in certain cases. Can you try running the `overwrite` function with a zipped up gdb as the input rather than the gdb feature class? Let me know what results you get.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Feb 2018 17:11:49 GMT</pubDate>
    <dc:creator>JohnYaist1</dc:creator>
    <dc:date>2018-02-13T17:11:49Z</dc:date>
    <item>
      <title>Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868821#M4561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using Python API's&amp;nbsp;flc.manager.overwrite method to overwrite an existing HFS with new data from a feat class in a fgdb. Although the operation says "success" the records returned are the either the same as before or they are zero.&lt;/P&gt;&lt;P&gt;To test, I downloaded a hosted feature service (HFS) as a fgdb, deleted a few records in ArcMap and then specified the following for overwriting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flc = arcgis.features.FeatureLayerCollection.fromitem(item)&lt;BR /&gt;flc&lt;/P&gt;&lt;P&gt;lyr = flc.layers[0]&lt;BR /&gt;lyr.query(return_count_only=True)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Output:39&lt;/PRE&gt;&lt;P&gt;flc.manager.overwrite(r"C:\data\Data\Projects\jupyter\WDFW_JupyterNotebooks_Master\Data\test.gdb\test_county")&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Output:{'success': True}

lyr = flc.layers[0]
lyr.query(return_count_only=True)

&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Output:39 #this should be 34 since I removed some counties from the local feature class&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;A second&amp;nbsp;test with adding&amp;nbsp;new features in ArcMap and then running method gave the "success:true" message&lt;/P&gt;&lt;P&gt;but results returned was zero records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas what I'm doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:49:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868821#M4561</guid>
      <dc:creator>TregChristopher</dc:creator>
      <dc:date>2021-12-12T10:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868822#M4562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/265243"&gt;Treg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Let me run some testing on this function. I'll get back to you on what I find.&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 01:35:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868822#M4562</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2018-02-06T01:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868823#M4563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Any luck troubleshooting this issue?&lt;/P&gt;&lt;P&gt;Treg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2018 16:43:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868823#M4563</guid>
      <dc:creator>TregChristopher</dc:creator>
      <dc:date>2018-02-13T16:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868824#M4564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/265243"&gt;Treg&amp;nbsp;&lt;/A&gt;&amp;nbsp;- I'm seeing the same problem you documented in certain cases. Can you try running the `overwrite` function with a zipped up gdb as the input rather than the gdb feature class? Let me know what results you get.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2018 17:11:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868824#M4564</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2018-02-13T17:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868825#M4565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’m still getting the same number of records after zipping&lt;/P&gt;&lt;P&gt;Also, I tried to diff pathways (below…1.include zip and gdb 2 include just zip) and they both gave “success” message and both returned the original # records instead of 5 less counties from the local version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lyr = flc.layers[0]&lt;/P&gt;&lt;P&gt;lyr.query(return_count_only=True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;39&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#the records in local'test_county_incomplete'=34&lt;/P&gt;&lt;P&gt;flc.manager.overwrite(r"C:\data\Data\Projects\jupyter\WDFW_JupyterNotebooks_Master\Data\test_county.gdb.zip\test_county.gdb\test_county_incomplete")&lt;/P&gt;&lt;P&gt;#flc.manager.overwrite(r"C:\data\Data\Projects\jupyter\WDFW_JupyterNotebooks_Master\Data\test_county.gdb.zip\test_county_incomplete")&lt;/P&gt;&lt;P&gt;{'success': True}&lt;/P&gt;&lt;P&gt;lyr = flc.layers[0]&lt;/P&gt;&lt;P&gt;lyr.query(return_count_only=True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;39&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2018 17:33:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868825#M4565</guid>
      <dc:creator>TregChristopher</dc:creator>
      <dc:date>2018-02-13T17:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868826#M4566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/people/treg"&gt;treg&lt;/A&gt;‌ -&lt;/P&gt;&lt;P&gt;I'm seeing similiar behavior to what you've documented with the &lt;EM&gt;FeatureLayerCollection.manager. &lt;/EM&gt;We've logged this issue internally and are investigating the &lt;EM&gt;featurelayercollection.manager.overwrite() &lt;/EM&gt;method.&amp;nbsp; Will the &lt;EM&gt;item.publish(overwrite=True) &lt;/EM&gt;work in your scenario?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 16:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868826#M4566</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2018-03-19T16:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868827#M4567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for looking into this further John. Your suggested workaround “item.publish(overwrite=True)” might work fine. I won’t have time to test anytime soon though. One of our eventual needs is to have some version of overwrite working so we can we can make major schema changes on existing Hosted Feature Services that are used by a survey123 form (but was published initially from a feature class…not created in S123). I’ll post a response to GeoNet when I have some time to investigate your workaround.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Treg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 17:29:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868827#M4567</guid>
      <dc:creator>TregChristopher</dc:creator>
      <dc:date>2018-03-20T17:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868828#M4568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having the same issue. The overwrite method essentially restores the Feature Service to its state when initially published, or last overwritten via desktop tools. I can delete all the features from a feature layer (from Pro, or from a Web Map), run the overwrite method, and my feature layer is back to the way it was prior to the deletes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John, are you able to provide a basic sample using the publish method? I'm have some trouble with the publish_parameters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 20:15:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868828#M4568</guid>
      <dc:creator>dmacq</dc:creator>
      <dc:date>2018-05-03T20:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868829#M4569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I am having the same issue as Treg.&amp;nbsp; Has the esri&amp;nbsp;team investigated the issues with&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;the&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;featurelayercollection.manager.overwrite()&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;method?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 17:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868829#M4569</guid>
      <dc:creator>StephenRoss</dc:creator>
      <dc:date>2018-07-12T17:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868830#M4570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This still wasn't working about a month ago but&amp;nbsp;there must have been a recent&amp;nbsp;update because&amp;nbsp;I can confirm that this is working now (Py API 1.4.1):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;##delete all features via truncate
tblTaxo.manager.truncate()

Pre-overwriteFeature count: 0

from arcgis.features import FeatureLayerCollection
tblTaxo_flayer_collection = FeatureLayerCollection.fromitem(items)

#call the overwrite() method which can be accessed using the manager property
tblTaxo_flayer_collection.manager.overwrite(tblTaxoGeolib)

&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Post-Overwrite Feature count: 2431&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868830#M4570</guid>
      <dc:creator>TregChristopher</dc:creator>
      <dc:date>2021-12-12T10:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868831#M4571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has this been resolved? Over a year later and I am having the same problem. Getting&amp;nbsp;{'success': True} from my script, but none of the features have been updated and the feature layer's symbology goes back how it was when first published.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if it has to do with trying to overwrite using a feature class which lives within a data set in a geodatabase. Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 22:05:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868831#M4571</guid>
      <dc:creator>KellyTaylor</dc:creator>
      <dc:date>2020-01-30T22:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868832#M4572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apparently I&amp;nbsp; haven't been using this much because I just tried again and it seemed unsuccessful...the record count remained the same between the original 2431 and the overwrite, which should now have 2434 records. I didn't check whether any changed attribute values were overwritten or remained the same but the lack of change to the record count would seem to indicate that nothing else was overwritten either.&lt;/P&gt;&lt;P&gt;This is a table in an SDE,so I don't think your source as a feature class in a file geodb is the problem. I did get a warning (not an error) that the dataframe (df) is being deprecated in favor of the spatial dataframe but since it was a warning, I don't think that is the error either.&lt;/P&gt;&lt;P&gt;I am now working off of Py API version 1.6.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Now removing all records from taxo table... Pre-Truncate Feature count: 2431 Post-Truncate Feature count: 0
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Now overwriting taxo table...
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Post-Overwrite Feature count: 2431

&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\feature.py:612: UserWarning: The SpatialDataFrame has been deprecated. `df` property will be removed as a future release. Use `sdf` instead.   warnings.warn(("The SpatialDataFrame has been deprecated. "&lt;/PRE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:49:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868832#M4572</guid>
      <dc:creator>TregChristopher</dc:creator>
      <dc:date>2021-12-12T10:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite not working, wrong number of records returned</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868833#M4573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For what it is worth, I am experiencing the same issue.&amp;nbsp; Drew described it pretty much perfectly, "t&lt;SPAN style="background-color: #ffffff;"&gt;he overwrite method essentially restores the Feature Service to its state when initially published, or last overwritten via desktop tools."&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2020 21:54:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/overwrite-not-working-wrong-number-of-records/m-p/868833#M4573</guid>
      <dc:creator>AshleyHayes2</dc:creator>
      <dc:date>2020-10-01T21:54:08Z</dc:date>
    </item>
  </channel>
</rss>

