Why would my script not be able to append data from a CSV file? I published the CSV file as a table on AGOL but when I run my script to test if it's properly updating new data, all the data from the table hosted on AGOL gets deleted and it sits empty with 0 records.
def overwrite_table():
org_url = "https://*.maps.arcgis.com/"
username = "username"
password = "password"
gis = GIS(org_url, username, password)
table_url = "https://services5.arcgis.com/*/arcgis/rest/services/Mainline_Construction_Report/FeatureServer/0"
tbl = FeatureLayer(table_url, gis=gis)
tbl.manager.truncate() # truncate table
data_csv = r'C:\\Users\\jnmiller\\Downloads\\Main.csv'
df = GeoAccessor.from_table(data_csv)
adds = df.spatial.to_featureset()
tbl.edit_features(adds=adds)