Skip to content

fix: Add default request headers to Kaleido calls#5588

Draft
camdecoster wants to merge 3 commits intomainfrom
cam/5562/add-default-kaleido-headers
Draft

fix: Add default request headers to Kaleido calls#5588
camdecoster wants to merge 3 commits intomainfrom
cam/5562/add-default-kaleido-headers

Conversation

@camdecoster
Copy link
Copy Markdown
Contributor

@camdecoster camdecoster commented May 4, 2026

Link to issue

Closes #5562

Description of change

Adds default headers to pass to kaleido.

Changes

  • Update minimum Kaleido version to v1.3.0
  • Add default headers to pass to Kaleido calls

Screenshots

Before After
image map

Testing strategy

  • Be on main
  • Create a venv with local plotly.py installed as an editable package
  • Run the following example (code in the venv) multiple times, checking the result each time:
    import plotly.graph_objects as go
    
    lat = 41.580472
    lon = -1.1161953
    
    fig = go.Figure(
        go.Scattermap(
            lat=[lat], lon=[lon], mode="markers", marker=dict(symbol="circle", size=30)
        )
    )
    fig.update_layout(
        map=dict(style="open-street-map", center=dict(lat=lat, lon=lon), zoom=16),
        margin={"r": 0, "t": 0, "l": 0, "b": 0},
    )
    
    img = fig.to_image("png")
    
    with open("map.png", "wb") as f:
        f.write(img)
  • Note that some tiles are being blocked with an error message from Open Street Map. This could take a number of tries before the blocked tiles show up.
  • Switch to this branch
  • Run through the same procedure
  • Note that no tiles are blocked

Additional information (optional)

  • This issue occurs because OSM requires certain headers to be provided for tile requests at a certain rate threshold to the OSM API
  • This rule wasn't enforced until recently, so it hasn't been a problem in the past

Guidelines

@camdecoster camdecoster self-assigned this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Access blocked for OpenStreetMap tiles

1 participant