I'm wondering how to use the Python Caller transformer to run the arcpy.RepairGeometry_management geoprocessing tool.
I'm working with some input File Geodatabase data that's getting re-projected and producing self-intersections. The Geometry Validator transformer is identifying these but not repairing them (i.e. they come out the Failed port, not the Repaired port). I confirmed that using ArcGIS Geoprocessing tools on the same machine fixes the self-intersections, so I wanted to use the Python Caller to do the exact same thing in the context of the FME Workspace. What I'm getting is a generic error though, see below. Maybe my syntax is incorrect but I've tried a few different ways and haven't had success. Any help would be appreciated!
Python Syntax:
import fme
import fmeobjects
import arcpy
# Template Function interface:
# When using this function, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
def repair(feature):
#Run repair geometry geoprocessing tool on each feature that failed geometry validation
arcpy.RepairGeometry_management(feature,"DELETE NULL")
pass
Translation error:
Python Exception <RuntimeError>: Object: Error in executing tool
Error encountered while calling function `repair'
PythonCaller (PythonFactory): PythonFactory failed to process feature
A fatal error has occurred. Check the logfile above for details
System (I know this is old!):
FME 2019.1.3.1
ArcGIS 10.1
Python 2.7