FeatureLayerCollection Attachments Search only returns the first 1000 records

552
5
05-09-2022 12:35 PM
JohnHuillery1
Occasional Contributor

After upgrading to Pro 2.9.2 (ArcGIS for Python API 1.9.1) the layer[<index>].attachments.search() method only return the first 1000 features.

data = FeatureLayerCollection(<valid feature service>, <valid GIS>)

main_attach = pd.DataFrame(data.layers[0].attachments.search())

#returns df with only the first 1000 attachment records

 

This is the main feature layer from a feature service created with Survey123. This only started happening since upgrading.

How do I override this?

0 Kudos
5 Replies
JohnHuillery1
Occasional Contributor

Tested this on Pro 2.8.0. It returned all records. Any ideas that don't involve rolling back to a previous version?

0 Kudos
jcarlson
MVP Esteemed Contributor

Does what you're doing require running from Pro? If not, I would suggest maintaining separate Python envs using Anaconda or Miniconda, and running your script from there. That would allow you to have a separate env for this script that has the Python API pegged at the previous version where it worked.

I notice feature limits like this when I'm not logged in. Can you confirm whether or not you're logging into the portal early in your script?

- Josh Carlson
Kendall County GIS
JohnHuillery1
Occasional Contributor

I'm logged in earlier in the script.

What is the process for rolling back the Python API? I have attempted this in the past on a cloned env without success.

 

0 Kudos
jcarlson
MVP Esteemed Contributor

What env are you cloning, though? In my experience, it's best to do these kinds of things totally separate from ArcGIS Pro, unless you really need arcpy for part of your script. In Anaconda, you can explicitly tell it what version of the API you want installed when you initially set it up.

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html 

- Josh Carlson
Kendall County GIS
0 Kudos
JohnHuillery1
Occasional Contributor

For this particular process I need arcpy.

Also, I'd like to use newer features in the API.

0 Kudos