mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: Time shifts with different granularity for ECharts (#24176)
This commit is contained in:
committed by
GitHub
parent
e922f0993d
commit
e5b7f7c9b5
@@ -14,6 +14,7 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from superset.constants import TimeGrain
|
||||
from superset.db_engine_specs.postgres import PostgresBaseEngineSpec
|
||||
|
||||
|
||||
@@ -24,14 +25,14 @@ class NetezzaEngineSpec(PostgresBaseEngineSpec):
|
||||
|
||||
_time_grain_expressions = {
|
||||
None: "{col}",
|
||||
"PT1S": "DATE_TRUNC('second', {col})",
|
||||
"PT1M": "DATE_TRUNC('minute', {col})",
|
||||
"PT1H": "DATE_TRUNC('hour', {col})",
|
||||
"P1D": "DATE_TRUNC('day', {col})",
|
||||
"P1W": "DATE_TRUNC('week', {col})",
|
||||
"P1M": "DATE_TRUNC('month', {col})",
|
||||
"P3M": "DATE_TRUNC('quarter', {col})",
|
||||
"P1Y": "DATE_TRUNC('year', {col})",
|
||||
TimeGrain.SECOND: "DATE_TRUNC('second', {col})",
|
||||
TimeGrain.MINUTE: "DATE_TRUNC('minute', {col})",
|
||||
TimeGrain.HOUR: "DATE_TRUNC('hour', {col})",
|
||||
TimeGrain.DAY: "DATE_TRUNC('day', {col})",
|
||||
TimeGrain.WEEK: "DATE_TRUNC('week', {col})",
|
||||
TimeGrain.MONTH: "DATE_TRUNC('month', {col})",
|
||||
TimeGrain.QUARTER: "DATE_TRUNC('quarter', {col})",
|
||||
TimeGrain.YEAR: "DATE_TRUNC('year', {col})",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user