You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "shrimad-mishra-cognoai (via GitHub)" <gi...@apache.org> on 2025/05/13 11:30:21 UTC

[I] Issue with Incremental Dataset Refresh and Auto Time Grain [superset]

shrimad-mishra-cognoai opened a new issue, #33421:
URL: https://github.com/apache/superset/issues/33421

   ### Bug description
   
   I made a virtual dataset with custom SQL queries, now I wanted to set the Time Grain to Auto in Chat or Dashboard and along with this I want to set the incremental refresh for the dataset.
   
   Can any guide me how to do this?
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [ ] 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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Issue with Incremental Dataset Refresh and Auto Time Grain [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #33421:
URL: https://github.com/apache/superset/issues/33421#issuecomment-2876535017

   <!-- Answer -->
   To enable Auto time grain in Superset, you need to configure the `TIME_GRAIN_ADDONS` and `TIME_GRAIN_ADDON_EXPRESSIONS` in the `config.py` file. These configurations allow you to define custom time grains and their corresponding SQL expressions for different database engines. Here's an example of how you might configure these:
   
   ```python
   # superset_config.py
   TIME_GRAIN_ADDONS = {
       "PT2S": "2 second",  # Example of adding a custom time grain
   }
   
   TIME_GRAIN_ADDON_EXPRESSIONS = {
       "clickhouse": {
           "PT2S": "toDateTime(intDiv(toUInt32(toDateTime({col})), 2)*2)",  # Custom expression for ClickHouse
       }
   }
   ```
   
   These configurations allow Superset to recognize and utilize custom time grains, which can be used in the Auto time grain feature. The default time grain setting that affects the Auto time grain feature is `'P1D'`, which stands for a period of 1 day <sup>[[1]](https://github.com/apache/superset/blob/master/superset/db_engine_specs/README.md)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/src/explore/controls.jsx)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/c94515ec-e74a-4d4b-823b-8badc979a5e2?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/c94515ec-e74a-4d4b-823b-8badc979a5e2?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/c94515ec-e74a-4d4b-823b-8badc979a5e2?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/c94515ec-e74a-4d4b-823b-8badc979a5e2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c94515ec-e74a-4d4b-823b-8badc979a5e2?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/c94515ec-e74a-4d4b-823b-8badc979a5e2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c94515ec-e74a-4d4b-823b-8badc979a5e2?feedback_type=other)</sup>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Issue with Incremental Dataset Refresh and Auto Time Grain [superset]

Posted by "shrimad-mishra-cognoai (via GitHub)" <gi...@apache.org>.
shrimad-mishra-cognoai commented on issue #33421:
URL: https://github.com/apache/superset/issues/33421#issuecomment-2876528218

   @dosu can tell me eact config which I need to have in the config.py for Auto time grain


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Issue with Incremental Dataset Refresh and Auto Time Grain [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #33421:
URL: https://github.com/apache/superset/issues/33421#issuecomment-2876137644

   <!-- Answer -->
   To set the Time Grain to Auto in Superset, you can configure it through the `superset/config.py` file. This involves using the `TIME_GRAIN_DENYLIST`, `TIME_GRAIN_ADDONS`, and `TIME_GRAIN_ADDON_EXPRESSIONS` configurations to manage time grains. The frontend component `TimeGrainFilterPlugin.tsx` handles the user interface for selecting time grains, allowing users to apply them dynamically in the UI <sup>[[1]](https://github.com/apache/superset/blob/master/superset/config.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/src/filters/components/TimeGrain/TimeGrainFilterPlugin.tsx)</sup>.
   
   Unfortunately, I couldn't find specific information on how Superset handles incremental dataset refreshes or how to configure them. It might be necessary to explore the Superset documentation or other resources for guidance on this feature. If you have any specific questions about the code components or configurations involved, feel free to ask!
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/73754f48-23a2-4f68-9145-931a05428278?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/73754f48-23a2-4f68-9145-931a05428278?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/73754f48-23a2-4f68-9145-931a05428278?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/73754f48-23a2-4f68-9145-931a05428278?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/73754f48-23a2-4f68-9145-931a05428278?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/73754f48-23a2-4f68-9145-931a05428278?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/73754f48-23a2-4f68-9145-931a05428278?feedback_type=other)</sup>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org