AnsweredAssumed Answered

AlterField does not work in memory

Question asked by deleted-user-DOkWkfrKbyfw on Apr 10, 2020
Latest reply on Apr 10, 2020 by deleted-user-DOkWkfrKbyfw

so, the following command works (env pointed to a gdb):

arcpy.management.AlterField(r'TestData_replaced', 'DMSLat','LAT_DMS','LAT_DMS')

However, if the same feature class is stored in memory, and I run it, like so:

arcpy.management.AlterField(r"memory\tempDataLayer","DMSLat","LAT_DMS","LAT_DMS")

I get the following:

---------------------------------------------------------------------------ExecuteError                              Traceback (most recent call last)<ipython-input-24-5d8b88a74d08> in <module>----> 1 arcpy.management.AlterField(r"memory\tempDataLayer","DMSLat","LAT_DMS","LAT_DMS")C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py in AlterField(in_table, field, new_field_name, new_field_alias, field_type, field_length, field_is_nullable, clear_field_alias)   4369         return retval   4370     except Exception as e:-> 4371         raise e   4372    4373 @gptooldoc('AssignDefaultToField_management', None)C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py in AlterField(in_table, field, new_field_name, new_field_alias, field_type, field_length, field_is_nullable, clear_field_alias)   4366     from arcpy.arcobjects.arcobjectconversion import convertArcObjectToPythonObject   4367     try:-> 4368         retval = convertArcObjectToPythonObject(gp.AlterField_management(*gp_fixargs((in_table, field, new_field_name, new_field_alias, field_type, field_length, field_is_nullable, clear_field_alias), True)))   4369         return retval   4370     except Exception as e:C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py in <lambda>(*args)    509         val = getattr(self._gp, attr)    510         if callable(val):--> 511             return lambda *args: val(*gp_fixargs(args, True))    512         else:    513             return convertArcObjectToPythonObject(val)ExecuteError: ERROR 000664: Invalid input: The type of dataset is not supported. Failed to execute (AlterField).

I have tried it in Jupyter and in the Python pane in ArcGIS Pro. It seems like it wants a PATH and memory is not considered one. Has anyone had success here?

Outcomes