codeant-ai-for-open-source[bot] commented on code in PR #43396:
URL: https://github.com/apache/superset/pull/43396#discussion_r3831856301
##########
tests/unit_tests/pandas_postprocessing/test_prophet.py:
##########
@@ -180,6 +180,22 @@ 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``, default 10000) is
+ documentation-only unless enforced at the point ``periods`` is consumed,
+ since every forecast period adds a future row per series.
+ """
+ with pytest.raises(InvalidPostProcessingError, match="must not exceed"):
+ prophet(
+ df=prophet_df,
+ time_grain="P1M",
+ periods=10001,
+ confidence_interval=0.8,
Review Comment:
**Suggestion:** The test hardcodes `10001` as the over-limit value, but
production enforcement uses the configurable `MAX_PROPHET_PERIODS` value. In an
environment configured above 10000, this value is valid and the test will not
raise `InvalidPostProcessingError`, potentially invoking an expensive forecast
instead. Derive the input from the configured maximum (or explicitly set the
configuration to 10000) so the test remains valid under supported configuration
overrides. [possible bug]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Prophet unit test becomes configuration-dependent.
- โ ๏ธ CI may perform an unnecessarily large forecast.
- โ ๏ธ Test can fail when the configured limit exceeds 10000.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/pandas_postprocessing/test_prophet.py
**Line:** 195:195
**Comment:**
*Possible Bug: The test hardcodes `10001` as the over-limit value, but
production enforcement uses the configurable `MAX_PROPHET_PERIODS` value. In an
environment configured above 10000, this value is valid and the test will not
raise `InvalidPostProcessingError`, potentially invoking an expensive forecast
instead. Derive the input from the configured maximum (or explicitly set the
configuration to 10000) so the test remains valid under supported configuration
overrides.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43396&comment_hash=f7b8b717d9c4ab94ee1f53c2a8990435117c29cf87b987ad7943958708dfc72d&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43396&comment_hash=f7b8b717d9c4ab94ee1f53c2a8990435117c29cf87b987ad7943958708dfc72d&reaction=dislike'>๐</a>
--
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]