villebro commented on code in PR #43396:
URL: https://github.com/apache/superset/pull/43396#discussion_r3832491880
##########
tests/unit_tests/pandas_postprocessing/test_prophet.py:
##########
@@ -180,6 +181,24 @@ def test_prophet_incorrect_periods():
)
+def test_prophet_periods_exceeding_max_raises():
+ """
+ ``periods`` comes from the unvalidated post-processing options dict; the
+ schema-declared upper bound (``MAX_PROPHET_PERIODS``, configurable, default
+ 10000) is documentation-only unless enforced at the point ``periods`` is
+ consumed, since every forecast period adds a future row per series. The
+ over-limit value is derived from the actual configured max, rather than
+ hardcoded, so the test stays valid if that config is overridden.
+ """
+ with pytest.raises(InvalidPostProcessingError, match="must not exceed"):
+ prophet(
+ df=prophet_df,
+ time_grain="P1M",
+ periods=get_max_prophet_periods() + 1,
Review Comment:
nit: In tests it tends to be customary to assert explicit values rather than
referencing defined constants. I suggest setting this to 10001 here so an
unintended change to `get_max_prophet_periods()` would fail the test as a
regression.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]