SEPURI-SAI-KRISHNA opened a new issue, #43356:
URL: https://github.com/apache/superset/issues/43356
### Bug description
`ChartDataProphetOptionsSchema.time_grain` validates against
`get_time_grain_choices()`, which merges `builtin_time_grains` with the
operator-configured `TIME_GRAIN_ADDONS`. `prophet()` then resolves the grain
through a static map that carries only the built-in values, so a configure
custom grain passes schema validation and then fails at the lookup.
The API therefore advertises a forecast value it cannot serve: the chart
query returns a validation error instead of a forecast.
Reproduction:
1. Add a custom grain to `superset_config.py`, e.g.
`TIME_GRAIN_ADDONS = {"PT10M": "10 minute"}`
2. Build a chart that uses Prophet forecasting and select that grain.
3. The request passes schema validation, then fails when `prophet()` resolves
the grain.
Expected: either the grain forecasts correctly, or it is not advertised as a
valid `time_grain` for Prophet in the first place.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.12
### Node version
Not applicable
### Browser
Not applicable
### Additional context
Why this is not a one-line fix: addon keys are arbitrary ISO-8601 durations
supplied by the operator, so the static map cannot simply be extended to cover
them. It needs a general duration-to-pandas-frequency converter, or Prophet's
schema has to exclude addon grains and advertise only what it can resolve.
Raised by codeant-ai in review on #43205 and confirmed there. It is
pre-existing rather than introduced by that PR, which only maps the remaining
built-in grains, so it was left out of scope and tracked here instead.
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [x] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
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]