Overwriting a feature service with a csv (with locations) through Python is corrupting my data

649
1
12-18-2020 02:23 PM
Teri
by
New Contributor

Hi,

I'm pretty new to working with the ESRI API in python. I am having a problem and I am pretty sure I am missing something fundamental

I have an automatic data collection process that produces a new csv every hour with vehicle positions. I am trying to push the csv to web maps when I get a new one so that we can see the hourly position as they update.

I am trying to push the data to both an Online instance and a Portal instance. The process seems to work flawlessly with Online, but after a number of updates the Portal instance just keeps getting corrupted. 

The process I have followed is

  • On both sites I have uploaded a copy of the csv and made a feature class, added it to maps, shared it etc. 
  • I then run a script that open the site(s) finds the feature by id
  • The script then executes the following with sufficient error catching to let me know when it fails:

data_collection=FeatureLayerCollection.fromitem(data_item)
OverwriteSuccess=None

try:
   OverwriteSuccess = data_collection.manager.overwrite(UpdatedSourceFile)
except Exception as e:
  MyException.extend([portalUrl, str(e)])

return MyException

  • data_item is the gis item found (and it is found, checking for that) on which ever platform I'm working with and UpdateSourceFile is an identically formatted csv file. It of course does contain different data as its an update.
  • The Portal update will work for a while and then stop because the data is corrupted (aka even trying to look at the data in a browser shows nothing)
  • The Online update hasn't failed yet (but whatever I have missed may burn me yet

So my question is two fold, why is the Portal overwrite so unstable while the Online one isn't? And what concept have I fundamentally missed to cause this in the first place.

Any help would be greatly appreciated. Thank you.

 

 

1 Reply
RobertSpál1
New Contributor III

Hi Teri, 

unfortunately, I don't have the answer but I just wanted to let you know that we have the same issue. I reported the bug to customer care and ESRI declined the bug saying they were unable to replicate the problem and I should use publish to update my data instead. However, I don't know-how and we instead use AGOL for that task now.

0 Kudos