You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/12/10 21:11:56 UTC

[GitHub] betodealmeida closed pull request #5915: Google spreadsheets

betodealmeida closed pull request #5915: Google spreadsheets
URL: https://github.com/apache/incubator-superset/pull/5915
 
 
   

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/setup.py b/setup.py
index 6985dbaada..542ca3fbec 100644
--- a/setup.py
+++ b/setup.py
@@ -69,6 +69,7 @@ def get_git_sha():
         'flask-wtf',
         'flower',  # deprecated
         'geopy',
+        'gsheetsdb>=0.1.8',
         'gunicorn',  # deprecated
         'humanize',
         'idna',
diff --git a/superset/assets/src/SqlLab/components/ExploreResultsButton.jsx b/superset/assets/src/SqlLab/components/ExploreResultsButton.jsx
index 26a246c57a..2c22b93508 100644
--- a/superset/assets/src/SqlLab/components/ExploreResultsButton.jsx
+++ b/superset/assets/src/SqlLab/components/ExploreResultsButton.jsx
@@ -164,11 +164,12 @@ class ExploreResultsButton extends React.PureComponent {
     );
   }
   render() {
+    const allowsSubquery = this.props.database && this.props.database.allows_subquery;
     return (
       <Button
         bsSize="small"
         onClick={this.onClick}
-        disabled={!this.props.database.allows_subquery}
+        disabled={!allowsSubquery}
         tooltip={t('Explore the result set in the data exploration view')}
       >
         <Dialog
diff --git a/superset/assets/src/SqlLab/components/SouthPane.jsx b/superset/assets/src/SqlLab/components/SouthPane.jsx
index 3f6fb42d24..f93947d162 100644
--- a/superset/assets/src/SqlLab/components/SouthPane.jsx
+++ b/superset/assets/src/SqlLab/components/SouthPane.jsx
@@ -64,7 +64,7 @@ class SouthPane extends React.PureComponent {
     }
     const dataPreviewTabs = props.dataPreviewQueries.map(query => (
       <Tab
-        title={t('Preview: `%s`', query.tableName)}
+        title={t('Preview: `%s`', decodeURIComponent(query.tableName))}
         eventKey={query.id}
         key={query.id}
       >
diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index d409c878a7..edbd1b224a 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -1499,6 +1499,13 @@ class DruidEngineSpec(BaseEngineSpec):
     }
 
 
+class GSheetsEngineSpec(SqliteEngineSpec):
+    """Engine for Google spreadsheets"""
+    engine = 'gsheets'
+    inner_joins = False
+    allows_subquery = False
+
+
 class KylinEngineSpec(BaseEngineSpec):
     """Dialect for Apache Kylin"""
 
diff --git a/superset/views/core.py b/superset/views/core.py
index 7faa1e2e11..c565e3a52e 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2267,10 +2267,11 @@ def sqllab_viz(self):
         }))
 
     @has_access
-    @expose('/table/<database_id>/<table_name>/<schema>/')
+    @expose('/table/<database_id>/<path:table_name>/<schema>/')
     @log_this
     def table(self, database_id, table_name, schema):
         schema = utils.js_string_to_python(schema)
+        table_name = parse.unquote_plus(table_name)
         mydb = db.session.query(models.Database).filter_by(id=database_id).one()
         payload_columns = []
         indexes = []
@@ -2326,10 +2327,11 @@ def table(self, database_id, table_name, schema):
         return json_success(json.dumps(tbl))
 
     @has_access
-    @expose('/extra_table_metadata/<database_id>/<table_name>/<schema>/')
+    @expose('/extra_table_metadata/<database_id>/<path:table_name>/<schema>/')
     @log_this
     def extra_table_metadata(self, database_id, table_name, schema):
         schema = utils.js_string_to_python(schema)
+        table_name = parse.unquote_plus(table_name)
         mydb = db.session.query(models.Database).filter_by(id=database_id).one()
         payload = mydb.db_engine_spec.extra_table_metadata(
             mydb, table_name, schema)


 

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


With regards,
Apache Git Services

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