Skip to content

FeatureLayerCollectionManager.create_view() crashes for FeatureLayerCollections with multiple layers (2.4.0) #2236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Wouter-van-Adrichem opened this issue Mar 12, 2025 · 0 comments
Assignees
Labels

Comments

@Wouter-van-Adrichem
Copy link

The method FeatureLayerCollectionManager.create_view() crashes for FeatureLayerCollections with multiple layers in version 2.4.0. I checked this for a feature service with only one layer and then the function worked fine.

The error originates in fs_view.manager.add_to_definition(add_def, future=True).result() in line 2972 of arcgis/features/managers.py . The error seems to originate in the REST API (as opposed to the ArcGIS API for Python). The error message is "Unknown Error", while I can see another message is "Error applying service definition" when I am debugging.

In the summary of FeatureLayerCollectionManager.add_to_definition() I see "For layer level modifications, run updates on each individual feature service layer object." This could be the problem?

I have a workaround for now. I copied the method and made my own implementation. Instead of adding all layers to add_def I just loop over all the layers and call fs_view.manager.add_to_definition(add_def, future=True).result() for each layer seperately.

It took me quite some time and frustration to first find the bug and to find a workaround.

P.S.
The typing for FeatureLayerCollectionManager.create_view() is incorrect, and I have seen this incorrect for a lot of methods as well. The typing for the parameter view_layers should be view_layers: list[FeatureLayer] instead of list[int] and view_tables: list[Table] instead of list[int].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants