Select to view content in your preferred language

arcpy.DeleteIdentical_management does not delete identicals in ESRI sqlite database.

2246
10
Jump to solution
03-11-2022 08:40 AM
MulfordnSons
Emerging Contributor

I'm attempting to use the arcpy method DeleteIdentical_management on an ESRI geometry type sqlite database. However, no records are removed from the database upon running. 

 

When I run delete identical in ArcPro, the identical records are deleted as expected. 

 

Is this a known issue?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
DrewFlater
Esri Regular Contributor

@MulfordnSons  this bug has been addressed in ArcGIS Pro 3.0. 

View solution in original post

10 Replies
KoryKramer
Esri Community Moderator

I don't think we're aware of this issue. If you have reproducible steps and example data that demonstrate the problem, I'd highly encourage you to report it as a bug here: https://support.esri.com/en/report-bug

Thank you

0 Kudos
DrewFlater
Esri Regular Contributor

I ran a quick test, and I got the same Delete Identical result when running inside Pro using the tool UI and running using arcpy in standalone Python.exe. In both case the single duplicate in my sqlite polygon feature class was deleted. 

DrewFlater_0-1647023010646.png

 

MulfordnSons
Emerging Contributor
 

The code sample below doesn't delete any duplicates, even if I just specify the shape field. Can ArcPro be open when this runs?

EDIT: when the application is closed, the duplicates still remain after running this tool on the sqlite feature class

 

 

 

fields = ['SHAPE', 'CommonName', 'ObservationDate']
arcpy.DeleteIdentical_management(r'F:\portfolio_projects\database\PA_Birds1.sqlite\main.pa_birds_pnts', fields)

 

 

 

0 Kudos
DrewFlater
Esri Regular Contributor

I tried with a list of fields as well and it still is correctly deleting one record. Make sure your field names are matching the real field names, including SHAPE (I don't think upper vs lower case will really matter, but it's something to check)

DrewFlater_0-1647025344935.png

 

0 Kudos
MulfordnSons
Emerging Contributor

Tried doing this within the ArcPro Python window - when I run the arcpy method, the feature class in the contents shows that the tool recognizes the feature class (it greys out, locks). However, after it runs, no identical geometries are deleted. 

 

Then, I run delete identical from the UI using only 'Shape' and all of the identical records are deleted as expected.

deleteidentical.PNG

0 Kudos
DrewFlater
Esri Regular Contributor

"However, after it runs, no identical geometries are deleted. "

Does the tool messages say if any duplicates were deleted? It might be that some cache inside the application is not updating and the deleted records are still showing. If the messages say that duplicates were deleted, try to close and reopen Pro and see if the duplicates still show or are gone now. 

 

Also I see in your Python window that you encountered an ERROR 999999. Can you show me what parameter settings you were using to produce that? 

0 Kudos
MulfordnSons
Emerging Contributor

Printed the messages for you to view below. Does seem to find the duplicates and it says they were deleted. However, after closing Pro and reopening, the number of features in the feature class is the same.

 

The error was randomly caused when I tried running in the python window the first time, I referenced the layer by name in the tool (as is was in the TOC) and it gave me that error. 

deleteidentical2.PNG

0 Kudos
DrewFlater
Esri Regular Contributor

Thanks I could reproduce the error 999999, we will work to get that fixed. I am not sure why the tool messaging and what displays in the app are different. A developer is looking into that as well. If you use the Report A Bug system linked above by Kory you will have an issue # for tracking when the issue will be addressed.

MulfordnSons
Emerging Contributor

using the GetCount() method returns the number of features before the delete identical as well, so it doesn't seem to actually be deleting anything in this instance. 

0 Kudos