Same here: as we haven't used calculated time columns, this problem didn't come 
to mind. Thanks for chiming in @rumbin . @victornoel: Luckily time grains can 
be modified locally by adding the following in your `superset_config.py` file:

```python
TIME_GRAIN_ADDON_FUNCTIONS = {
    'postgres': {
        None: '"{col}"',
        'PT1S': "DATE_TRUNC('second', \"{col}\") AT TIME ZONE 'UTC'",
        'PT1M': "DATE_TRUNC('minute', \"{col}\") AT TIME ZONE 'UTC'",
        'PT1H': "DATE_TRUNC('hour', \"{col}\") AT TIME ZONE 'UTC'",
        'P1D': "DATE_TRUNC('day', \"{col}\") AT TIME ZONE 'UTC'",
        'P1W': "DATE_TRUNC('week', \"{col}\") AT TIME ZONE 'UTC'",
        'P1M': "DATE_TRUNC('month', \"{col}\") AT TIME ZONE 'UTC'",
        'P0.25Y': "DATE_TRUNC('quarter', \"{col}\") AT TIME ZONE 'UTC'",
        'P1Y': "DATE_TRUNC('year', \"{col}\") AT TIME ZONE 'UTC'",
    }
}
```

This will replace the built-in time grains with the ones defined above. Perhaps 
this is the best solution for now.

[ Full content available at: 
https://github.com/apache/incubator-superset/pull/5962 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to