Repository navigation
Conversation
The static typing change added `assert m.history` and `assert m.changepoints` to plot_plotly. Both are pandas objects, whose truth value raises, so plot_plotly failed on every call. Use `is not None` as the rest of plot.py does, and add tests that call plot_plotly.
This branch has not been deployed
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.
Since #2720,
plot_plotlyraises on every call, including theplot_plotly(m, forecast)call from the quick start docs:The static typing change added
assert m.historyandassert m.changepointsto narrow the optional types.m.historyis a DataFrame andm.changepointsis a Series, and pandas refuses to convert either to a bool, so the asserts raise instead of passing. The second one runs even with the defaultchangepoints=False, so fixing only the first is not enough. Both asserts are in v1.4.0 and v1.5.0.add_changepoints_to_plotandplot_components_plotlyalready useis not None/ a dict and are not affected.This changes both asserts to
is not None, as the rest ofplot.pydoes.pyrefly checkstill reports no errors.Tests: no test called
plot_plotlyitself, which is why CI did not catch it even though the dev extras install plotly.TestPlotPlotlyintest_plot.pyreuses themodel_and_forecastfixture: it checks that the actual and predicted traces carrym.historyandyhat, and that withtrend=True, changepoints=True, changepoints_threshold=0the trend trace is drawn and every changepoint is marked. The 4 new cases fail on main with the error above and pass with the change. The fullprophet/testssuite passes (147 passed, 2 skipped) with pandas 3.1.1, numpy 2.5.4 and plotly 7.1.0.This change was drafted with Claude Code (claude-opus-5-5); the test results above are from the runs described.