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

Open
#2,510 4 comments 0 reactions 1 assignee View on GitHub

@nanaeaubry is already working on this.

Since Jun 12, 2026.

Assessment

This issue has not been assessed yet.

Description

bug

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:

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:

Traceback (most recent call last):
  File "C:\ArcGISAFP_03\Python_Scripts\Completed\07_Layer_Settings\rename_layer.py", line 61, in <module>
    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.

Dominant language
Python
Stars
2.2k
Forks
1.1k
Avg merge
2h 40m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Esri/arcgis-python-api

All issues in Esri/arcgis-python-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.