I am trying to follow the steps provided in this blog: https://community.esri.com/t5/arcgis-api-for-python-blog/updating-arcgis-online-hosted-feature-layer-with/ba-p/1113966 and cannot find a solution to encountered errors when running from the Python window in ArcGIS Pro 3.2.1
import smartsheet
import pandas as pd
from arcgis.gis import GIS
access_token = 'xyz'
smartsheet = smartsheet.Smartsheet(access_token)
sheetID = '1234567890'
def smartsheet_to_dataframe(sheet):
col_names = [col.title for col in sheet.columns]
row = []
for row in sheet.rows:
cells = []
for cell in row.cells:
cells.append(cell.value)
rows.append(cells)
data_frame = pd.DataFrame(rows, columns=col_names)
return data_frame
sheet = smartsheet.Sheets.get_sheet(sheetID)
df = smartsheet_to_dataframe(sheet)
output_csv = r"C:\TEMP\temp.csv"
df.to_csv(output_csv)
My attempts to run this script keep prompting the error:
Traceback (most recent call last):
File "<string>", line 22, in <module>
File "<string>", line 11, in smartsheet_to_dataframe
AttributeError: 'Error' object has no attribute 'columns'
Some digging made mention that the arcpy version the environment is directed to may not be compatible with the functions being used, but I have not been able to make any headway regarding that.
Thanks in advance for any help!