AnsweredAssumed Answered

trying to run geoprocessing tool against service on portal..

Question asked by ardaiel on Dec 16, 2019

I'm not quite sure where this should go, so cross posting. We have an on premise portal with a feature service published. We're trying to write a python script that will run a geoprocessing tool against this service. Right now it's extremely simple; authenticate to portal, look at the service, and run arcpy.Statistics_analysis against it. All we want to do is get an output table of statistics. Now, if I do this in python directly against the database, no problems. But when running it against the service... it SEES the service, but it fails on the analysis. Can anyone help?? 


def run(self):

lines = arcpy.SearchCursor(

for line in lines:

stats_table = "C:/temp/services_test.gdb/stats_out"
# stats_table = self.config.get("scratch_fgdb_path")
# print(stats_table)
stat = [["st_length", "SUM"]]

arcpy.Statistics_analysis(lines, stats_table, stat)