liyuance closed pull request #4952: add 30minutes support under time granularity
URL: https://github.com/apache/incubator-superset/pull/4952
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/superset/assets/src/explore/components/controls/DateFilterControl.jsx
b/superset/assets/src/explore/components/controls/DateFilterControl.jsx
index 3669c9fade..e22a32006c 100644
--- a/superset/assets/src/explore/components/controls/DateFilterControl.jsx
+++ b/superset/assets/src/explore/components/controls/DateFilterControl.jsx
@@ -13,7 +13,7 @@ import ControlHeader from '../ControlHeader';
import PopoverSection from '../../../components/PopoverSection';
const RELATIVE_TIME_OPTIONS = ['ago', 'from now'];
-const TIME_GRAIN_OPTIONS = ['seconds', 'minutes', 'days', 'weeks', 'months',
'years'];
+const TIME_GRAIN_OPTIONS = ['seconds', 'minutes', 'hours', 'days', 'weeks',
'months', 'years'];
const propTypes = {
animation: PropTypes.bool,
diff --git a/superset/assets/src/explore/controls.jsx
b/superset/assets/src/explore/controls.jsx
index 0bb2680654..8dbba958f0 100644
--- a/superset/assets/src/explore/controls.jsx
+++ b/superset/assets/src/explore/controls.jsx
@@ -772,6 +772,7 @@ export const controls = {
['PT30S', '30 seconds'],
['PT1M', '1 minute'],
['PT5M', '5 minutes'],
+ ['PT30M', '30 minutes'],
['PT1H', '1 hour'],
['PT6H', '6 hour'],
['P1D', '1 day'],
diff --git a/superset/connectors/druid/models.py
b/superset/connectors/druid/models.py
index 4ff5e5fa09..364c8b839d 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -529,8 +529,8 @@ def full_name(self):
def time_column_grains(self):
return {
'time_columns': [
- 'all', '5 seconds', '30 seconds', '1 minute',
- '5 minutes', '1 hour', '6 hour', '1 day', '7 days',
+ 'all', '5 seconds', '30 seconds', '1 minute', '5 minutes',
+ '30 minutes', '1 hour', '6 hour', '1 day', '7 days',
'week', 'week_starting_sunday', 'week_ending_saturday',
'month',
],
@@ -762,6 +762,7 @@ def granularity(period_name, timezone=None, origin=None):
'30 seconds': 'PT30S',
'1 minute': 'PT1M',
'5 minutes': 'PT5M',
+ '30 minutes': 'PT30M',
'1 hour': 'PT1H',
'6 hour': 'PT6H',
'one day': 'P1D',
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]