Skip to content

fix: Add default request headers to Kaleido calls - #5588

Merged
camdecoster merged 6 commits into
mainfrom
cam/5562/add-default-kaleido-headers
May 13, 2026
Merged

fix: Add default request headers to Kaleido calls#5588
camdecoster merged 6 commits into
mainfrom
cam/5562/add-default-kaleido-headers

Conversation

@camdecoster

@camdecostercamdecoster commented May 4, 2026

Copy link
Copy Markdown
Contributor

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
  • Update updateplotlyjsdev command to use GitHub URLs

Screenshots

BeforeAfter
imagemap

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:
    importplotly.graph_objectsasgolat=41.580472lon=-1.1161953fig=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")
    withopen("map.png", "wb") asf:
    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
  • The bulk of the changes in uv.lock are due to changes to how uv resolves dependencies
  • The changes to commands.py were necessary to remove obsolete CircleCI references

Guidelines

@camdecostercamdecoster self-assigned this May 4, 2026
@camdecoster
camdecoster marked this pull request as ready for review May 11, 2026 18:10

@emilyklemilykl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camdecoster
camdecoster merged commit 07bc2bf into mainMay 13, 2026
25 checks passed
@camdecoster
camdecoster deleted the cam/5562/add-default-kaleido-headers branch May 13, 2026 19:39
Sign up for freeto 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

2 participants

@camdecoster@emilykl