[GitHub] alanmcruickshank commented on issue #3821: Group the dashboards into Folders when there are too many to view.

2017-11-17 Thread GitBox
alanmcruickshank commented on issue #3821: Group the dashboards into Folders 
when there are too many to view.
URL: 
https://github.com/apache/incubator-superset/issues/3821#issuecomment-345227716
 
 
   @graceguo-supercat 
   
   I love the idea of tagging, rather than tabs or folders. That would allow a 
single dashboard to appear in multiple groups.
   
   If we do go down that route - I'd love to be able to set a specific tag to 
control the dashboards available on the welcome page. That way we can direct 
people to a specific curated set of dashboard as a starting point.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] alanmcruickshank commented on issue #3884: Please add one column in the ?add Slices to Dashboard? Pop-up window

2017-11-17 Thread GitBox
alanmcruickshank commented on issue #3884: Please add one column in the ?add 
Slices to Dashboard? Pop-up window
URL: 
https://github.com/apache/incubator-superset/issues/3884#issuecomment-345229061
 
 
   @luciuschina  - I can have a crack at this one.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] gdeepali commented on issue #1996: Custom SQL queries with filters

2017-11-17 Thread GitBox
gdeepali commented on issue #1996: Custom SQL queries with filters
URL: 
https://github.com/apache/incubator-superset/issues/1996#issuecomment-345181747
 
 
   Is it possible to get current logged in user using jinja templates?
   For example, I want to do something like
   
   SELECT * FROM tbl
   WHERE 
   uername = {{current_username}} 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xrmx commented on issue #3894: Scanning or Refreshing Druid Datasource fails whilst using Gunicorn

2017-11-17 Thread GitBox
xrmx commented on issue #3894: Scanning or Refreshing Druid Datasource fails 
whilst using Gunicorn
URL: 
https://github.com/apache/incubator-superset/issues/3894#issuecomment-345180657
 
 
   Could you reproduce without a gevent worker?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xrmx commented on issue #3898: How to use a count metric in Superset?

2017-11-17 Thread GitBox
xrmx commented on issue #3898: How to use a count metric in Superset?
URL: 
https://github.com/apache/incubator-superset/issues/3898#issuecomment-345180401
 
 
   Nope, you do it manually or you script it.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xrmx commented on issue #3881: [linting] Cleaning up linting documentation

2017-11-17 Thread GitBox
xrmx commented on issue #3881: [linting] Cleaning up linting documentation
URL: 
https://github.com/apache/incubator-superset/pull/3881#issuecomment-345180026
 
 
   I suspect not many people run tox on their machine, but just rely on CI. 
Either way it's good for me.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] alanmcruickshank opened a new pull request #3900: Add datasource to the SliceAddView modal (#3884)

2017-11-17 Thread GitBox
alanmcruickshank opened a new pull request #3900: Add datasource to the 
SliceAddView modal (#3884)
URL: https://github.com/apache/incubator-superset/pull/3900
 
 
   Fix for issue #3884 adding datasource to the "Add Slice" modal on the 
dashboard view.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] john-bodley commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
john-bodley commented on issue #3895: [druid] Fixing issue 3894  
multi-processing w/ Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345333095
 
 
   @Mogball per @xrmx's comment in the issue this may actually be a Gevent 
issue. I'm not certain whether we want to disable that or go with the approach 
outlined in this PR, i.e., moving from multi-processing to multi-threading. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] john-bodley commented on issue #3894: Scanning or Refreshing Druid Datasource fails whilst using Gevent with Gunicorn

2017-11-17 Thread GitBox
john-bodley commented on issue #3894: Scanning or Refreshing Druid Datasource 
fails whilst using Gevent with Gunicorn
URL: 
https://github.com/apache/incubator-superset/issues/3894#issuecomment-345332631
 
 
   @xrmx it seems like this is actually a Gevent issue as opposed to Gunicorn. 
I'm updated the description of the issue.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] graceguo-supercat closed pull request #3893: Only refreshing non instant filters on apply

2017-11-17 Thread GitBox
graceguo-supercat closed pull request #3893: Only refreshing non instant 
filters on apply
URL: https://github.com/apache/incubator-superset/pull/3893
 
 
   

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/javascripts/dashboard/reducers.js 
b/superset/assets/javascripts/dashboard/reducers.js
index 8d7b7f483d..5001fd13d4 100644
--- a/superset/assets/javascripts/dashboard/reducers.js
+++ b/superset/assets/javascripts/dashboard/reducers.js
@@ -134,9 +134,9 @@ const dashboard = function (state = {}, action) {
   // d3.merge pass in array of arrays while some value form filter 
components
   // from and to filter box require string to be process and return
 } else if (state.filters[sliceId][col] instanceof Array) {
-  newFilter = d3.merge([state.filters[sliceId][col], vals]);
+  newFilter[col] = d3.merge([state.filters[sliceId][col], vals]);
 } else {
-  newFilter = d3.merge([[state.filters[sliceId][col]], vals])[0] || '';
+  newFilter[col] = d3.merge([[state.filters[sliceId][col]], vals])[0] 
|| '';
 }
 filters = { ...state.filters, [sliceId]: newFilter };
   }
diff --git a/superset/assets/visualizations/filter_box.jsx 
b/superset/assets/visualizations/filter_box.jsx
index bdcf978d3d..7653ec2cc2 100644
--- a/superset/assets/visualizations/filter_box.jsx
+++ b/superset/assets/visualizations/filter_box.jsx
@@ -72,7 +72,14 @@ class FilterBox extends React.Component {
 return control;
   }
   clickApply() {
-this.props.onChange(Object.keys(this.state.selectedValues)[0], [], true, 
true);
+const { selectedValues } = this.state;
+Object.keys(selectedValues).forEach((fltr, i, arr) => {
+  let refresh = false;
+  if (i === arr.length - 1) {
+refresh = true;
+  }
+  this.props.onChange(fltr, selectedValues[fltr], false, refresh);
+});
 this.setState({ hasChanged: false });
   }
   changeFilter(filter, options) {
@@ -90,7 +97,9 @@ class FilterBox extends React.Component {
 const selectedValues = Object.assign({}, this.state.selectedValues);
 selectedValues[fltr] = vals;
 this.setState({ selectedValues, hasChanged: true });
-this.props.onChange(fltr, vals, false, this.props.instantFiltering);
+if (this.props.instantFiltering) {
+  this.props.onChange(fltr, vals, false, true);
+}
   }
   render() {
 let dateFilter;


 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xrmx commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
xrmx commented on issue #3895: [druid] Fixing issue 3894  multi-processing w/ 
Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345359353
 
 
   If you are just waiting on druid threads instead of processes should be 
fine. To avoid the possible creation of ton of threads you can initialize the 
pool outside the function so the number is fixed.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xrmx commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
xrmx commented on issue #3895: [druid] Fixing issue 3894  multi-processing w/ 
Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345359353
 
 
   If you are just waiting on druid IO threads instead of processes should be 
fine. To avoid the possible creation of ton of threads you can initialize the 
pool outside the function so the number is fixed.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] john-bodley commented on issue #3583: [3541] Augmenting datasources uniqueness constraints

2017-11-17 Thread GitBox
john-bodley commented on issue #3583: [3541] Augmenting datasources uniqueness 
constraints
URL: 
https://github.com/apache/incubator-superset/pull/3583#issuecomment-345424552
 
 
   @mistercrunch I've resolve all the merge conflicts.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Mogball commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
Mogball commented on issue #3895: [druid] Fixing issue 3894  multi-processing 
w/ Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345418884
 
 
   `latest_metadata` doesn't make any calls to SQLAlchemy ? 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] john-bodley commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
john-bodley commented on issue #3895: [druid] Fixing issue 3894  
multi-processing w/ Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345404884
 
 
   @mistercrunch @Mogball @xrmx I'm not overly familiar with this portion of 
the code base, and the interactions with Gevent, I'm merely trying to fix an 
issue which is plaguing us in production. 
   
   I can't fathom the scale @Mogball of your Druid datasources, but for us this 
request takes mere seconds and thus I'm unsure whether the 4x speedup (maximum) 
of a multi-threaded environment outweighs the additional complexity, potential 
thread-safeness etc.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Mogball commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
Mogball commented on issue #3895: [druid] Fixing issue 3894  multi-processing 
w/ Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345406215
 
 
   The speed up is more than just 4x (or whatever the number of available 
threads). Most of the time is spent waiting for Druid to respond, which means 
that the metadata requests are issued more or less simultaneously for each 
datasource, and then processed when they all start coming back. This makes a 
difference of like 40 seconds to 3 seconds (when hard refreshing all 
datasources).
   
   This should be thread-safe since there is no interaction outside of the 
datasource object and with the Superset backend during refresh.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Mogball commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
Mogball commented on issue #3895: [druid] Fixing issue 3894  multi-processing 
w/ Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345406215
 
 
   The speed up is more than just 4x (or whatever the number of available 
threads). Most of the time is spent waiting for Druid to respond, which means 
that the metadata requests are issued more or less at simultaneously for each 
datasource, and then processed when they all start coming back. This makes a 
difference of like 40 seconds to 3 seconds (when hard refreshing all 
datasources).
   
   This should be thread-safe since there is no interaction outside of the 
datasource object and with the Superset backend during refresh.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Mogball commented on a change in pull request #3897: [druid] Catch IOError when fetching Druid datasource time boundary

2017-11-17 Thread GitBox
Mogball commented on a change in pull request #3897: [druid] Catch IOError when 
fetching Druid datasource time boundary
URL: 
https://github.com/apache/incubator-superset/pull/3897#discussion_r151822485
 
 

 ##
 File path: superset/connectors/druid/models.py
 ##
 @@ -563,11 +563,14 @@ def latest_metadata(self):
 """Returns segment metadata from the latest segment"""
 logging.info('Syncing datasource [{}]'.format(self.datasource_name))
 client = self.cluster.get_pydruid_client()
-results = client.time_boundary(datasource=self.datasource_name)
-if not results:
-return
-max_time = results[0]['result']['maxTime']
-max_time = dparse(max_time)
+try:
+results = client.time_boundary(datasource=self.datasource_name)
+if not results:
 
 Review comment:
   Just noticed this now but we could fall back to `datetime.now()` when the 
function returns `None` as well


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] michellethomas commented on issue #3890: [dashboard bug]Instant control should take effect instantly

2017-11-17 Thread GitBox
michellethomas commented on issue #3890: [dashboard bug]Instant control should 
take effect instantly
URL: 
https://github.com/apache/incubator-superset/pull/3890#issuecomment-345400997
 
 
   lgtm


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] graceguo-supercat closed pull request #3890: [dashboard bug]Instant control should take effect instantly

2017-11-17 Thread GitBox
graceguo-supercat closed pull request #3890: [dashboard bug]Instant control 
should take effect instantly
URL: https://github.com/apache/incubator-superset/pull/3890
 
 
   

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/javascripts/chart/ChartContainer.jsx 
b/superset/assets/javascripts/chart/ChartContainer.jsx
index 11c432221f..d517677ec4 100644
--- a/superset/assets/javascripts/chart/ChartContainer.jsx
+++ b/superset/assets/javascripts/chart/ChartContainer.jsx
@@ -12,10 +12,10 @@ function mapStateToProps({ charts }, ownProps) {
 chartUpdateEndTime: chart.chartUpdateEndTime,
 chartUpdateStartTime: chart.chartUpdateStartTime,
 latestQueryFormData: chart.latestQueryFormData,
+lastRendered: chart.lastRendered,
 queryResponse: chart.queryResponse,
 queryRequest: chart.queryRequest,
 triggerQuery: chart.triggerQuery,
-triggerRender: chart.triggerRender,
   };
 }
 
diff --git a/superset/assets/javascripts/chart/chartReducer.js 
b/superset/assets/javascripts/chart/chartReducer.js
index 835ee94034..ade8c5bf68 100644
--- a/superset/assets/javascripts/chart/chartReducer.js
+++ b/superset/assets/javascripts/chart/chartReducer.js
@@ -12,6 +12,7 @@ export const chartPropType = {
   chartUpdateEndTime: PropTypes.number,
   chartUpdateStartTime: PropTypes.number,
   latestQueryFormData: PropTypes.object,
+  queryRequest: PropTypes.object,
   queryResponse: PropTypes.object,
   triggerQuery: PropTypes.bool,
   lastRendered: PropTypes.number,
@@ -24,6 +25,7 @@ export const chart = {
   chartUpdateEndTime: null,
   chartUpdateStartTime: now(),
   latestQueryFormData: null,
+  queryRequest: null,
   queryResponse: null,
   triggerQuery: true,
   lastRendered: 0,
diff --git 
a/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx 
b/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx
index e3ea7f2a73..43f6c012e6 100644
--- a/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx
+++ b/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx
@@ -9,6 +9,7 @@ import ControlPanelsContainer from './ControlPanelsContainer';
 import SaveModal from './SaveModal';
 import QueryAndSaveBtns from './QueryAndSaveBtns';
 import { getExploreUrl } from '../exploreUtils';
+import { areObjectsEqual } from '../../reduxUtils';
 import { getFormDataFromControls } from '../stores/store';
 import { chartPropType } from '../../chart/chartReducer';
 import * as exploreActions from '../actions/exploreActions';
@@ -50,6 +51,11 @@ class ExploreViewContainer extends React.Component {
 if (np.controls.datasource.value !== this.props.controls.datasource.value) 
{
   this.props.actions.fetchDatasourceMetadata(np.form_data.datasource, 
true);
 }
+// if any control value changed and it's an instant control
+if (Object.keys(np.controls).some(key => (np.controls[key].renderTrigger &&
+  !areObjectsEqual(np.controls[key].value, 
this.props.controls[key].value {
+  this.props.actions.renderTriggered(new Date().getTime(), 
this.props.chart.chartKey);
+}
   }
 
   componentDidUpdate() {
diff --git a/superset/assets/javascripts/explore/index.jsx 
b/superset/assets/javascripts/explore/index.jsx
index 2247019f08..fa92d7c97d 100644
--- a/superset/assets/javascripts/explore/index.jsx
+++ b/superset/assets/javascripts/explore/index.jsx
@@ -43,13 +43,14 @@ const initState = {
 [chartKey]: {
   chartKey,
   chartAlert: null,
-  chartStatus: null,
+  chartStatus: 'loading',
   chartUpdateEndTime: null,
   chartUpdateStartTime: now(),
   latestQueryFormData: getFormDataFromControls(controls),
+  queryRequest: null,
   queryResponse: null,
   triggerQuery: true,
-  triggerRender: false,
+  lastRendered: 0,
 },
   },
   saveModal: {


 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] john-bodley commented on issue #3897: [druid] Catch IOError when fetching Druid datasource time boundary

2017-11-17 Thread GitBox
john-bodley commented on issue #3897: [druid] Catch IOError when fetching Druid 
datasource time boundary
URL: 
https://github.com/apache/incubator-superset/pull/3897#issuecomment-345403832
 
 
   @Mogball I updated the logic to revert to the current time. @mistercrunch I 
went through the code to where this was added, and it seems like there's never 
been a check for this, i.e., here's the code from 
[0.8.5](https://github.com/apache/incubator-superset/blob/0.8.5/caravel/models.py#L864).


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch closed pull request #3879: Allow users to specify label->color mapping

2017-11-17 Thread GitBox
mistercrunch closed pull request #3879: Allow users to specify label->color 
mapping
URL: https://github.com/apache/incubator-superset/pull/3879
 
 
   

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/docs/faq.rst b/docs/faq.rst
index d825ef5ba0..0ca341e8da 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -221,3 +221,19 @@ When adding columns to a table, you can have Superset 
detect and merge the
 new columns in by using the "Refresh Metadata" action in the
 ``Source -> Tables`` page. Simply check the box next to the tables
 you want the schema refreshed, and click ``Actions -> Refresh Metadata``.
+
+Is there a way to force the use specific colors?
+
+
+It is possible on a per-dashboard basis by providing a mapping of
+labels to colors in the ``JSON Metadata`` attribute using the
+``label_colors`` key.
+
+..code::
+
+   {
+ "label_colors": {
+   "Girls": "#FF69B4",
+   "Boys": "#ADD8E6"
+ }
+   }
diff --git a/superset/assets/javascripts/dashboard/reducers.js 
b/superset/assets/javascripts/dashboard/reducers.js
index 8d7b7f483d..57475a5d79 100644
--- a/superset/assets/javascripts/dashboard/reducers.js
+++ b/superset/assets/javascripts/dashboard/reducers.js
@@ -6,6 +6,7 @@ import * as actions from './actions';
 import { getParam } from '../modules/utils';
 import { alterInArr, removeFromArr } from '../reduxUtils';
 import { applyDefaultFormData } from '../explore/stores/store';
+import { getColorFromScheme } from '../modules/colors';
 
 export function getInitialState(bootstrapData) {
   const { user_id, datasources, common } = bootstrapData;
@@ -25,6 +26,15 @@ export function getInitialState(bootstrapData) {
 //
   }
 
+  // Priming the color palette with user's label-color mapping provided in
+  // the dashboard's JSON metadata
+  if (dashboard.metadata && dashboard.metadata.label_colors) {
+const colorMap = dashboard.metadata.label_colors;
+for (const label in colorMap) {
+  getColorFromScheme(label, null, colorMap[label]);
+}
+  }
+
   dashboard.posDict = {};
   dashboard.layout = [];
   if (dashboard.position_json) {
diff --git a/superset/assets/javascripts/modules/colors.js 
b/superset/assets/javascripts/modules/colors.js
index 0c3d06a09d..03c3bb2ed4 100644
--- a/superset/assets/javascripts/modules/colors.js
+++ b/superset/assets/javascripts/modules/colors.js
@@ -103,17 +103,36 @@ export const spectrums = {
   ],
 };
 
+/**
+ * Get a color from a scheme specific palette (scheme)
+ * The function cycles through the palette while memoizing labels
+ * association to colors. If the function is called twice with the
+ * same string, it will return the same color.
+ *
+ * @param {string} s - The label for which we want to get a color
+ * @param {string} scheme - The palette name, or "scheme"
+ * @param {string} forcedColor - A color that the caller wants to
+forcibly associate to a label.
+ */
 export const getColorFromScheme = (function () {
-  // Color factory
   const seen = {};
-  return function (s, scheme) {
+  const forcedColors = {};
+  return function (s, scheme, forcedColor) {
 if (!s) {
   return;
 }
 const selectedScheme = scheme ? ALL_COLOR_SCHEMES[scheme] : 
ALL_COLOR_SCHEMES.bnbColors;
-let stringifyS = String(s);
+let stringifyS = String(s).toLowerCase();
 // next line is for superset series that should have the same color
 stringifyS = stringifyS.replace('---', '');
+
+if (forcedColor && !forcedColors[stringifyS]) {
+  forcedColors[stringifyS] = forcedColor;
+}
+if (forcedColors[stringifyS]) {
+  return forcedColors[stringifyS];
+}
+
 if (seen[selectedScheme] === undefined) {
   seen[selectedScheme] = {};
 }
diff --git a/superset/assets/spec/javascripts/modules/colors_spec.jsx 
b/superset/assets/spec/javascripts/modules/colors_spec.jsx
index 31ccea8326..2a24633fe7 100644
--- a/superset/assets/spec/javascripts/modules/colors_spec.jsx
+++ b/superset/assets/spec/javascripts/modules/colors_spec.jsx
@@ -8,7 +8,7 @@ describe('colors', () => {
 const color1 = getColorFromScheme('CA');
 expect(color1).to.equal(ALL_COLOR_SCHEMES.bnbColors[0]);
   });
-  it('series with same scheme should have the same color', () => {
+  it('getColorFromScheme series with same scheme should have the same color', 
() => {
 const color1 = getColorFromScheme('CA', 'bnbColors');
 const color2 = getColorFromScheme('CA', 'googleCategory20c');
 const color3 = getColorFromScheme('CA', 'bnbColors');
@@ -19,7 +19,22 @@ describe('colors', () => {
 expect(color1).to.equal(color3);
 expect(color4).to.equal(ALL_COLOR_SCHEMES.bnbColors[1]);
   });
+  it('getColorFromScheme forcing colors 

[GitHub] john-bodley commented on a change in pull request #3897: [druid] Catch IOError when fetching Druid datasource time boundary

2017-11-17 Thread GitBox
john-bodley commented on a change in pull request #3897: [druid] Catch IOError 
when fetching Druid datasource time boundary
URL: 
https://github.com/apache/incubator-superset/pull/3897#discussion_r151827678
 
 

 ##
 File path: superset/connectors/druid/models.py
 ##
 @@ -563,11 +563,14 @@ def latest_metadata(self):
 """Returns segment metadata from the latest segment"""
 logging.info('Syncing datasource [{}]'.format(self.datasource_name))
 client = self.cluster.get_pydruid_client()
-results = client.time_boundary(datasource=self.datasource_name)
-if not results:
-return
-max_time = results[0]['result']['maxTime']
-max_time = dparse(max_time)
+try:
+results = client.time_boundary(datasource=self.datasource_name)
+if not results:
 
 Review comment:
   @Mogball I updated the logic per your comment. PTAL.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] liuzn4ever commented on issue #3656: Export Dashboard doesn't work

2017-11-17 Thread GitBox
liuzn4ever commented on issue #3656: Export Dashboard doesn't work
URL: 
https://github.com/apache/incubator-superset/issues/3656#issuecomment-345416549
 
 
   A page is intercepted by the browser ,you can use the Edge of win10?then you 
can download the dashboard file,and its suffix name is .pickle


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch closed pull request #3899: [druid] Renaming refresh_async method

2017-11-17 Thread GitBox
mistercrunch closed pull request #3899: [druid] Renaming refresh_async method
URL: https://github.com/apache/incubator-superset/pull/3899
 
 
   

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/connectors/druid/models.py 
b/superset/connectors/druid/models.py
index 4c8a016cb5..998344146f 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -122,9 +122,9 @@ def refresh_datasources(
 ds_refresh.append(datasource_name)
 else:
 return
-self.refresh_async(ds_refresh, merge_flag, refreshAll)
+self.refresh(ds_refresh, merge_flag, refreshAll)
 
-def refresh_async(self, datasource_names, merge_flag, refreshAll):
+def refresh(self, datasource_names, merge_flag, refreshAll):
 """
 Fetches metadata for the specified datasources andm
 merges to the Superset database


 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch closed pull request #3900: Add datasource to the SliceAddView modal (#3884)

2017-11-17 Thread GitBox
mistercrunch closed pull request #3900: Add datasource to the SliceAddView 
modal (#3884)
URL: https://github.com/apache/incubator-superset/pull/3900
 
 
   

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/javascripts/dashboard/components/SliceAdder.jsx 
b/superset/assets/javascripts/dashboard/components/SliceAdder.jsx
index 03e0cb80c7..6c2ea0e4b7 100644
--- a/superset/assets/javascripts/dashboard/components/SliceAdder.jsx
+++ b/superset/assets/javascripts/dashboard/components/SliceAdder.jsx
@@ -54,7 +54,8 @@ class SliceAdder extends React.Component {
 const slices = response.result.map(slice => ({
   id: slice.id,
   sliceName: slice.slice_name,
-  vizType: slice.vizType,
+  vizType: slice.viz_type,
+  datasourceLink: slice.datasource_link,
   modified: slice.modified,
 }));
 
@@ -165,6 +166,14 @@ class SliceAdder extends React.Component {
 >
   {t('Viz')}
 
+ datasourceLink}
+>
+  {t('Datasource')}
+
 

[GitHub] mistercrunch commented on a change in pull request #3892: [Bugfix]: Subquery time filter logic for sqla datasources (partitions)

2017-11-17 Thread GitBox
mistercrunch commented on a change in pull request #3892: [Bugfix]: Subquery 
time filter logic for sqla datasources (partitions)
URL: 
https://github.com/apache/incubator-superset/pull/3892#discussion_r151828077
 
 

 ##
 File path: superset/connectors/sqla/models.py
 ##
 @@ -529,11 +529,7 @@ def get_sqla_query(  # sqla
 inner_select_exprs += [inner_main_metric_expr]
 subq = select(inner_select_exprs)
 subq = subq.select_from(tbl)
-inner_time_filter = dttm_col.get_time_filter(
-inner_from_dttm or from_dttm,
-inner_to_dttm or to_dttm,
-)
-subq = subq.where(and_(*(where_clause_and + [inner_time_filter])))
+subq = subq.where(and_(*(time_filters + where_clause_and)))
 
 Review comment:
   The `inner_time_filter` logic is there to support the `time_compare` related 
logic so that the same series exist are used for both queries. Look for 
`time_compare` in `viz.py` to see how it's used on the caller side...


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch closed pull request #3897: [druid] Catch IOError when fetching Druid datasource time boundary

2017-11-17 Thread GitBox
mistercrunch closed pull request #3897: [druid] Catch IOError when fetching 
Druid datasource time boundary
URL: https://github.com/apache/incubator-superset/pull/3897
 
 
   

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/connectors/druid/models.py 
b/superset/connectors/druid/models.py
index 4c8a016cb5..51ce9e33d2 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -563,11 +563,15 @@ def latest_metadata(self):
 """Returns segment metadata from the latest segment"""
 logging.info('Syncing datasource [{}]'.format(self.datasource_name))
 client = self.cluster.get_pydruid_client()
-results = client.time_boundary(datasource=self.datasource_name)
-if not results:
-return
-max_time = results[0]['result']['maxTime']
-max_time = dparse(max_time)
+try:
+results = client.time_boundary(datasource=self.datasource_name)
+except IOError:
+results = None
+if results:
+max_time = results[0]['result']['maxTime']
+max_time = dparse(max_time)
+else:
+max_time = datetime.now()
 # Query segmentMetadata for 7 days back. However, due to a bug,
 # we need to set this interval to more than 1 day ago to exclude
 # realtime segments, which triggered a bug (fixed in druid 0.8.2).


 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch commented on issue #1996: Custom SQL queries with filters

2017-11-17 Thread GitBox
mistercrunch commented on issue #1996: Custom SQL queries with filters
URL: 
https://github.com/apache/incubator-superset/issues/1996#issuecomment-345417447
 
 
   more like:
   ```
   SELECT * FROM tbl
   WHERE
   uername = '{{ current_username() }}'
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch commented on issue #3891: [BUGFIX]: Fixing dttm_sql_literal to use python_date_format

2017-11-17 Thread GitBox
mistercrunch commented on issue #3891: [BUGFIX]: Fixing dttm_sql_literal to use 
python_date_format 
URL: 
https://github.com/apache/incubator-superset/pull/3891#issuecomment-345417893
 
 
   Travis never fired for this one, maybe pushing a new commit on top will 
trigger it?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch commented on issue #3861: overlap of Legends with the ToolTip

2017-11-17 Thread GitBox
mistercrunch commented on issue #3861: overlap of Legends with the ToolTip 
URL: 
https://github.com/apache/incubator-superset/pull/3861#issuecomment-345417995
 
 
   Sorry I meant of snapshot of what the visualization looks like not the code.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mistercrunch commented on issue #3895: [druid] Fixing issue 3894 multi-processing w/ Gunicorn

2017-11-17 Thread GitBox
mistercrunch commented on issue #3895: [druid] Fixing issue 3894  
multi-processing w/ Gunicorn
URL: 
https://github.com/apache/incubator-superset/pull/3895#issuecomment-345418062
 
 
   Heads up that there are caveats with thread-safety around SQLAlchemy


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:
us...@infra.apache.org


With regards,
Apache Git Services