Greetings,
I used this script about 8 months ago, working on SQL Server, but I cannot get it working on PostGres??
The ESRI Python example is:
https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-postgresql/update-statistics.htm#ESRI_SECTION1_EB0B43256A2B4027AF7E3246FD0EADCE
Error is at the dataList??
dataList = arcpy.ListTables() + arcpy.ListFeatureClasses() + arcpy.ListRasters()
print(dataList)
Because of the no data error I added:
tbldataset = arcpy.ListDatasets(feature_type='Tables')
featdataset = arcpy.ListDatasets(feature_type='FeatureClasses')
rastdataset = arcpy.ListDatasets(feature_type='Rasters')
ListTables = tbldataset
ListFeatureClasses = featdataset
ListRasters = rastdataset
Appreciate a pointer where this is going wrong??
Regards,
Clive
Solved! Go to Solution.
The traceback shows multiple "List" functions are returning Python None. The List functions will return empty lists when nothing is found and will return Python None when the workspace isn't valid. So, you should look upstream in your code to see how you are setting your environment workspace before calling these functions.
Cannot get it working? What isn't working, exactly? Are you getting an error or unexpected results? If an error, it helps to paste the error and traceback for people to see. if unexpected results, what you are expected and what are you getting?
Hi Joshua,
I was expecting to return all datasets within SDE. I am getting no data, thought I stated that in first post.
TypeError Traceback (most recent call last) <ipython-input-24-772e862cda86> in <module> 37 38 ---> 39 dataList = arcpy.ListTables() + arcpy.ListFeatureClasses() + arcpy.ListRasters() 40 print(dataList) 41 TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
Don't get why there is a no data error??
Greetings,
It was a user issue, the same first part of the script works for non-admin tasks.
Regards,
Clive
The traceback shows multiple "List" functions are returning Python None. The List functions will return empty lists when nothing is found and will return Python None when the workspace isn't valid. So, you should look upstream in your code to see how you are setting your environment workspace before calling these functions.