After returning to work after my summer holidays, I was told that a Python script which we use very frequently had stopped working. The relevant part of the script uploads objects to ArcGIS Online of various types, including File Geodatabases, using Folder.add().
As mentioned in the documentation this function is supposed to return a concurrent.futures.Future object and nothing else. In the past this was true. However what has started to happen is that if the object added is a File Geodatabase it now returns some kind of Job object instead, of a type which I haven't seen documented. (type() names it as arcgis.gis._impl._content_manager.folder.core.Job.) Whether this happens to other types I don't know, I haven't investigated this beyond what our script does.
Crucially, this Job object lacks the done() method which breaks both my script and the sample code on the linked documentation page, although result() still works on it. I was able to fix my script after I discovered that the Job object contained a property called futures. But now I need to have code to detect the type returned, since it varies depending on the type of object added.
I haven't found this change documented anywhere, so I'm not sure what's going on, if this is an intentional change that was not documented or a bug. But whatever it is, it broke scripts that we rely on and it was not easy to fix due to the lack of documentation.
Can you try with the latest version of the Python API (2.4.2)? The `folder.add` method returns a `Job` object. The `Job` object has the `done` method to allow for polling of the upload status and the `result()` method to retrieve the `Item`.
I'll verify API version and try again shortly.
Thanks @KenGalliher1 , I upgraded to 2.4.2, and I'm now able to call `done()` for the `folder.add` returned object
Well, seems that it's allowable directly through miniconda.
I am using API version 2.4.1 & arcpy. Suggestions in this thread have been helpful, but ultimately I ended up using arcpy.management.SharePackage for uploading/publishing vector tile packages.
There was something peculiar about the set of tile packages i was trying to upload via folder.add. Uploads were timing out even after I set a 2 hour timeout. Other packages of the same size and larger are uploading in minutes via folder.add.