dosubot[bot] commented on issue #40119: URL: https://github.com/apache/superset/issues/40119#issuecomment-4459826288
<!-- Answer --> @ketansharma78 There's a configuration issue — `ENABLE_CORS` and `ENABLE_PROXY_FIX` are **top-level config variables**, not feature flags. Placing them inside `FEATURE_FLAGS` has no effect [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L289-L292) [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L830-L834). Your config should look like this: ```python # Top-level variables (NOT inside FEATURE_FLAGS) ENABLE_CORS = True ENABLE_PROXY_FIX = True FEATURE_FLAGS = { "DASHBOARD_RBAC": True, "ENABLE_TEMPLATE_PROCESSING": True, } ``` This is important because if you're behind a reverse proxy and `ENABLE_PROXY_FIX` isn't actually taking effect, it could cause CSRF/session issues that result in 403 errors when saving metrics. **Regarding `get_time_filter()`**: With `ENABLE_TEMPLATE_PROCESSING: True` set correctly, the function should be available. A couple of things to note: - It returns a `TimeFilter` object with `from_expr`, `to_expr`, and `time_range` properties [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/jinja_context.py#L434-L508) - If no time range filter is active on the chart, `from_expr` and `to_expr` will be `None` — you can use the `default` parameter to handle this [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/tests/unit_tests/jinja_context_test.py#L1272-L1285): ```sql {% set tf = get_time_filter("my_col", default="Last week") %} ``` Could you clarify what error you're getting with `get_time_filter()`? Is it an "undefined" error, or is it returning empty values? Also, have you run `superset init` after the upgrade? That resyncs permissions and may resolve the 403 issue. <!-- 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).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-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=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=e4ae3c90-8016-4824-84bc-3713612bf2f9) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-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=static-docs-share-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]
