dosubot[bot] commented on issue #40807: URL: https://github.com/apache/superset/issues/40807#issuecomment-4633318233
<!-- Answer --> Hi @serecruit999! I'm [Dosu](https://go.dosu.dev/dosubot) and I'm helping the Apache Superset team. This regression matches [Issue #39681](https://github.com/apache/superset/issues/39681), which describes the same behavior — time filters being applied to granulated expressions instead of raw columns when `TEMPORAL_RANGE` filters carry a `grain` parameter [[1]](https://github.com/apache/superset/issues/39681). **Root cause:** The filter processing logic in `superset/models/helpers.py` checks for a `grain` parameter on each filter. When present, it applies the filter to the granulated expression via `col_obj.get_timestamp_expression(time_grain=filter_grain)` instead of the raw column [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/models/helpers.py#L1779-L1786). Two PRs introduced `grain` parameters to `TEMPORAL_RANGE` filters: - **PR #38978** (merged 2026-03-31): Added `grain: timeGrain` to TEMPORAL_RANGE in MCP chart generation [[3]](https://github.com/apache/superset/pull/38978) - **PR #39668** (merged 2026-05-01): Added `grain` to TEMPORAL_RANGE in drill-to-detail [[4]](https://github.com/apache/superset/pull/39668) **Proposed fix:** [PR #39683](https://github.com/apache/superset/pull/39683) addresses this by improving temporal column resolution — it prefers the chart's x-axis when resolving `time_range` and pins granularity to the x-axis temporal column to keep grouping aligned [[5]](https://github.com/apache/superset/pull/39683). This PR is not yet merged. **Workaround in the meantime:** You can inspect the chart's query payload to confirm if the `TEMPORAL_RANGE` filter has an unexpected `grain` parameter. Removing or overriding that grain on the filter (e.g., via a custom filter or by adjusting how the chart is configured) would cause the filter to fall back to the raw column path [[6]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/models/helpers.py#L1783-L1786). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=39751725-af4c-45e3-82f4-b5ef01b742f4) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) -- 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]
