I am trying to automatize the rebuild of file geodatabase indexes using arcpy v10.6, but I encounter an ERROR 000837 The workspace is not the correct workspace type.
Why? Does arcpy.RebuildIndexes_management() works only with Enterprise geodatabases? Then, how to rebuild indexes in file geodatabases?
Thank you
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> os
workspace <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:/tmp/myDatabase.gdb"</SPAN>
fc <SPAN class="operator token">=</SPAN> <SPAN class="string token">"MyFeatureClass"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Exists<SPAN class="punctuation token">(</SPAN>workspace<SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN><SPAN class="token boolean">True</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Exists<SPAN class="punctuation token">(</SPAN>os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>workspace<SPAN class="punctuation token">,</SPAN> fc<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN><SPAN class="token boolean">True</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>RebuildIndexes_management<SPAN class="punctuation token">(</SPAN>workspace<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NO_SYSTEM"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">[</SPAN>fc<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ALL"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN>ERROR <SPAN class="number token">000837</SPAN> The workspace <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> the correct workspace type<SPAN class="punctuation token">.</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>