ArcPy to handle NA types when utilizing to_featureclass() conversion from Spatially Enabled Dataframe

457
0
03-17-2023 09:46 AM
Status: Open
Labels (1)
feralcatcolonist
New Contributor III

Currently when a Spatially Enabled Dataframe contains the NA Type, to process to_featureclass() fails less than gracefully.

  1. The error message returned does not provide context for the row number and field that contain the error225453354-55236124-13e7-4ad7-9f9a-e9fec0ebcab2.png
  2. The error message could be avoided entirely with additionally processing from ArcPy to handle what is otherwise a standard datatype. Per this ArcGIS API for Python Idea by @vmarquart_max-boegl : https://community.esri.com/t5/arcgis-api-for-python-ideas/support-a-pd-na-to-np-nan-conversion-insid...

 

The idea here is to handle NA types better within the function. While the NA type may not be handled by the endpoint database or file location, it is a relatively easy conversion process to make the item a null value or other value that is supported.

  • The maximal solution here is for that conversion to be handled "under the hood" by ArcPy and abstract this error checking/handling away from the user.
  • The minimal solution would be better error message output to provide a user explicit instruction on both row number (object_id since this is coming out of a spatially enabled dataframe) and column name/index.

Github issue that prompted this request: https://github.com/Esri/arcgis-python-api/issues/1494#event-8780331130