I'm trying to do something simple using the following help doc, but I can not seem to publish.
https://geosaurus.maps.arcgis.com/home/item.html?id=a1db6db172bc49a8932daacc2ed3d3ac#preview
I'm able to add it to the Portal, but I cannot get it to publish.
from IPython.display import display
from arcgis.gis import GIS
import os
gis = GIS('Home')
csv_file = r'C:\Users\jpilbeam\Downloads\c19_Vaccine_Current.csv'
csv_item = gis.content.add({}, csv_file)#add csv to Portal
csv_layer = csv_item.publish(None, file_type='csv')
Error:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
In [15]:
Line 1: csv_layer = csv_item.publish(None, file_type='csv')
File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in publish:
Line 10353: elif not buildInitialCache and ret[0]['type'].lower() == 'image service':
KeyError: 'type'
---------------------------------------------------------------------------
Other attempts:
csv_layer = csv_item.publish()
Error:
KeyError: 'type'
csv_layer = csv_item.publish('csv')
Error:
ValueError: dictionary update sequence element #0 has length 1; 2 is required