You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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].
The text was updated successfully, but these errors were encountered:
The method
FeatureLayerCollectionManager.create_view()
crashes forFeatureLayerCollections
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 ofarcgis/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 callfs_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 parameterview_layers
should beview_layers: list[FeatureLayer]
instead oflist[int]
andview_tables: list[Table]
instead oflist[int]
.The text was updated successfully, but these errors were encountered: