BUG
When attempting to delete a feature dataset containing a topology, an error message is returned. The feature dataset is deleted as well.
Code:
import arcpy
arcpy.env.workspace = r"C:\data\test.gdb"
arcpy.Delete_management("majorrds")
This is a known issue. The software attempts to warn the user when a topology exists in the feature dataset, which must be deleted before deleting the feature dataset. However, since the topology is a part of the feature dataset itself, it is deleted and the error message is generated.
Insert the following code. Be sure to adjust the file path of the location of the dataset.
Code:
import arcpy
arcpy.env.workspace = r"C:\data\test.gdb"
try:
arcpy.Delete_management("majorrds")
print "copied zoning"
except:
print "A warning was generated"
Get help from ArcGIS experts
Download the Esri Support App