Esri / Esri/arcgis-python-api

Map object | MapContent object | update_layer() method not working in 2.4.3

Aperta
#2,510 4 commenti 0 reazioni 1 assegnatario Rivendicata da @nanaeaubry Vedi su GitHub
bug
Lingua principale
Python
Stelle
2.2k
Fork
1.2k
Merge medio
2h 40m
PR unite (30g)
2

Descrizione

**Describe the bug**
In 2.4.2 the Map object, MapContent object, update_layer() worked just fine. In 2.4.3, the same workflows fail to run.

The layer is not a group layer or a layer in a group.

**To Reproduce**
Steps to reproduce the behavior:
```python
from arcgis.gis import GIS
from arcgis.map import Map

agol = GIS("home")

wm_item = agol.content.get("WM_ITEM_ID")

webmap = Map(wm_item)

options_dict = {
"title" : "National Inventory of Architectural Heritage (NIAH)"
}

## fails here
webmap.content.update_layer(
index=0,
options=options_dict
)

webmap.update()

```
error:
```python
Traceback (most recent call last):
File "C:\ArcGISAFP_03\Python_Scripts\Completed\07_Layer_Settings\rename_layer.py", line 61, in
webmap.content.update_layer(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
index=lyr_index,
^^^^^^^^^^^^^^^^
options=options_dict
^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\map\map_widget.py", line 2230, in update_layer
self._helper.update_layer(
~~~~~~~~~~~~~~~~~~~~~~~~~^
index,
^^^^^^
...<5 lines>...
form,
^^^^^
)
^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\map\_utils.py", line 1972, in update_layer
if isinstance(layer, group_layer.BaseGroup):
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute 'BaseGroup'
```
**Screenshots**
If applicable, add screenshots to help explain your problem.

Image

**Expected behavior**
The above is simply attempting to rename a layer. Worked perfect in 2.4.2 and fails in 2.4.3

**Platform (please complete the following information):**
- OS: Windows 11
- Browser: Chrome / Edge
- Python API Version: 2.4.3

**Additional context**
Add any other context about the problem here, attachments etc.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.