mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
Google spreadsheets (#5915)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes
This commit is contained in:
1
setup.py
1
setup.py
@@ -69,6 +69,7 @@ setup(
|
||||
'flask-wtf',
|
||||
'flower', # deprecated
|
||||
'geopy',
|
||||
'gsheetsdb>=0.1.8',
|
||||
'gunicorn', # deprecated
|
||||
'humanize',
|
||||
'idna',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
>
|
||||
|
||||
@@ -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"""
|
||||
|
||||
|
||||
@@ -2267,10 +2267,11 @@ class Superset(BaseSupersetView):
|
||||
}))
|
||||
|
||||
@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 @@ class Superset(BaseSupersetView):
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user