Conversation
The docs and tutorial extras were pinned to the deprecated kaleido 0.2.x because kaleido v1 raised "TypeError: Type is not JSON serializable: Timestamp" when a figure spec carried pandas Timestamp values. kaleido 1.4.0 handles datetime-like objects in its orjson fallback (plotly/Kaleido#461), which is the upstream fix OpenSTEF#938 was waiting for, so lift the constraint to >=1.4 and refresh the lock file. Fixes OpenSTEF#938 Assisted-by: Claude Opus 5 Signed-off-by: Jakub Krasuski <kubamax4@gmail.com>
egordm
reviewed
Sep 17, 2026
egordm
left a comment
Collaborator
There was a problem hiding this comment.
Nice find! Overall looks great.
Just a note to remove the comments that are no longer necessary since we no longer pin a specific version.
I will run some final checks tomorrow and merge.
They explained a constraint that no longer exists now that the version is a plain lower bound. The reasoning stays in OpenSTEF#938 and the commit history. Assisted-by: Claude Opus 5 Signed-off-by: Jakub Krasuski <kubamax4@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Lifts the kaleido pin in
docs/andexamples/from the deprecated 0.2.x line to>=1.4, and refreshesuv.lock.Closes #938
The issue's acceptance criteria offered two routes: fix the plotter, or "confirm kaleido >1.3.x fixed the regression upstream". The second one is now met.
@egordm's analysis pinned the bug to
_orjson_defaultinkaleido/_kaleido_tab/_tab.py, which only handled.tolist()and raised onpd.Timestamp, and noted that no upstream PR existed yet. One does now: plotly/Kaleido#461 by @gaoflow adds anisoformat()fallback for datetime-like objects, shipped in kaleido v1.4.0 on 2026-08-31. The fix itself is theirs; what this PR adds is the verification and the lift.Because it sits in the central serializer rather than at a call site, it covers the paths the plotter-side workaround could not reach, which is why #942 reverted
_normalize_x_dataand constrained the dependency instead.Verification
1. The call sites, 1.3.0 versus 1.4.0. Same script, same plotly 7.1.0 and pandas 3.0.5, only kaleido differs:
TypeError: Type is not JSON serializable: Timestampadd_vrectwith Timestamp boundsTypeErrorlayout.xaxis.rangewith TimestampsTypeErrorTypeErrorThe last three are the call sites #938 lists as not covered by the workaround.
2. The real plotter.
ForecastTimeSeriesPlotterwith measurements, a forecast and P10/P50/P90 bands, exported throughpio.to_image, succeeds on 1.4.0 (60054 bytes). It also succeeds on 1.3.0, because_add_single_quantile_polygonalready keepsxas aDatetimeIndex. That workaround is left untouched: it costs nothing and keeps the export robust against future regressions, as the issue describes.3. The docs build.
docs-checkrun on my fork against this branch:uv sync --frozenthenpoe docs, green on ubuntu-latest, 24.7 MB of HTML uploaded.nb_execution_modeiscacheand a fresh runner has no cache, so the tutorials were executed and their figures exported through kaleido 1.4.0 rather than replayed.Why
>=1.4and not>=1.01.0 through 1.3 still carry the Timestamp bug, so the floor has to be the release containing plotly/Kaleido#461.
This also resolves the other two reasons the pin mentioned: v1 is the maintained line, so the deprecated v0 goes away, and 1.4.0 ships a single
py3-none-anywheel, so the missing macOS arm64 wheel that ruled out0.2.1.post1is no longer a factor. Note that v1 does not bundle a browser and uses a system Chrome or Chromium, which the CI runner already has, as the green docs build shows.Type of change
Breaking changes checklist
Not applicable: this only moves a docs/tutorial build dependency. No library code changes.
AI disclosure
Assisted-by: Claude Opus 5)Checklist
poe all --checkpasses locallygit commit -s)On the two unchecked boxes: there is no code change to test, and the upstream behaviour is already covered by
test_orjson_encoder.pyin plotly/Kaleido#461. I ran the docs build rather thanpoe all --check, since that is the job this pin affects; happy to run the full check if you would like it on the record.