mirror of https://github.com/apache/superset.git
[hotfix] getting presto on track
This commit is contained in:
parent
9f8eef498c
commit
508feb2bad
|
@ -36,9 +36,6 @@ class SqlEditorTopToolbar extends React.Component {
|
|||
});
|
||||
return `SELECT ${cols}\nFROM ${table.name}`;
|
||||
}
|
||||
selectStar(table) {
|
||||
this.props.actions.queryEditorSetSql(this.props.queryEditor, this.getSql(table));
|
||||
}
|
||||
popTab(table) {
|
||||
const qe = {
|
||||
id: shortid.generate(),
|
||||
|
@ -169,7 +166,7 @@ class SqlEditorTopToolbar extends React.Component {
|
|||
</div>
|
||||
<hr />
|
||||
<div className="m-t-5">
|
||||
{tables.map((table) => <TableElement table={table} />)}
|
||||
{tables.map((table) => <TableElement table={table} queryEditor={this.props.queryEditor} />)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -15,13 +15,18 @@ class TableElement extends React.Component {
|
|||
cols += ', ';
|
||||
}
|
||||
});
|
||||
const sql = `SELECT ${cols}\nFROM ${this.props.table.name}`;
|
||||
return `SELECT ${cols}\nFROM ${this.props.table.name}`;
|
||||
}
|
||||
setSelectStar () {
|
||||
this.props.actions.queryEditorSetSql(this.props.queryEditor, this.selectStar());
|
||||
}
|
||||
popSelectStar() {
|
||||
const qe = {
|
||||
id: shortid.generate(),
|
||||
title: this.props.table.name,
|
||||
dbId: this.props.table.dbId,
|
||||
autorun: true,
|
||||
sql,
|
||||
sql: this.selectStar(),
|
||||
};
|
||||
this.props.actions.addQueryEditor(qe);
|
||||
}
|
||||
|
@ -68,13 +73,13 @@ class TableElement extends React.Component {
|
|||
<ButtonGroup className="ws-el-controls pull-right">
|
||||
<Link
|
||||
className="fa fa-pencil m-l-2"
|
||||
onClick={this.selectStar.bind(this)}
|
||||
onClick={this.setSelectStar.bind(this)}
|
||||
tooltip="Run query in a new tab"
|
||||
href="#"
|
||||
/>
|
||||
<Link
|
||||
className="fa fa-plus-circle m-l-2"
|
||||
onClick={this.selectStar.bind(this)}
|
||||
onClick={this.popSelectStar.bind(this)}
|
||||
tooltip="Run query in a new tab"
|
||||
href="#"
|
||||
/>
|
||||
|
@ -92,6 +97,7 @@ class TableElement extends React.Component {
|
|||
}
|
||||
TableElement.propTypes = {
|
||||
table: React.PropTypes.object,
|
||||
queryEditor: React.PropTypes.object,
|
||||
actions: React.PropTypes.object,
|
||||
};
|
||||
TableElement.defaultProps = {
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
"react-redux": "^4.4.5",
|
||||
"react-resizable": "^1.3.3",
|
||||
"react-select": "^1.0.0-beta14",
|
||||
"react-syntax-highlighter": "^2.1.1",
|
||||
"react-syntax-highlighter": "^2.3.0",
|
||||
"reactable": "^0.13.2",
|
||||
"redux": "^3.5.2",
|
||||
"redux-localstorage": "^0.4.1",
|
||||
|
|
|
@ -94,10 +94,8 @@ def get_sql_results(query_id, return_results=True):
|
|||
if progress > query.progress:
|
||||
query.progress = progress
|
||||
db.session.commit()
|
||||
time.sleep(200)
|
||||
|
||||
time.sleep(1)
|
||||
polled = cursor.poll()
|
||||
# TODO(b.kyryliuk): check for the kill signal.
|
||||
|
||||
columns = None
|
||||
data = None
|
||||
|
|
|
@ -211,6 +211,7 @@ def init(caravel):
|
|||
'Security',
|
||||
'UserDBModelView',
|
||||
'SQL Lab'):
|
||||
|
||||
sm.add_permission_role(alpha, perm)
|
||||
sm.add_permission_role(admin, perm)
|
||||
gamma = sm.add_role("Gamma")
|
||||
|
|
|
@ -25,8 +25,7 @@ from flask_babel import gettext as __
|
|||
from flask_babel import lazy_gettext as _
|
||||
from flask_appbuilder.models.sqla.filters import BaseFilter
|
||||
|
||||
from sqlalchemy import create_engine, select, text
|
||||
from sqlalchemy.sql.expression import TextAsFrom
|
||||
from sqlalchemy import create_engine
|
||||
from werkzeug.routing import BaseConverter
|
||||
from wtforms.validators import ValidationError
|
||||
|
||||
|
@ -38,6 +37,7 @@ from caravel import (
|
|||
config = app.config
|
||||
log_this = models.Log.log_this
|
||||
can_access = utils.can_access
|
||||
QueryStatus = models.QueryStatus
|
||||
|
||||
|
||||
class BaseCaravelView(BaseView):
|
||||
|
@ -1415,7 +1415,7 @@ class Caravel(BaseCaravelView):
|
|||
if not mydb:
|
||||
json_error_response(
|
||||
'Database with id {} is missing.'.format(database_id),
|
||||
models.QueryStatus.FAILED)
|
||||
QueryStatus.FAILED)
|
||||
|
||||
if not (self.can_access('all_datasource_access', 'all_datasource_access') or
|
||||
self.can_access('database_access', mydb.perm)):
|
||||
|
@ -1431,6 +1431,7 @@ class Caravel(BaseCaravelView):
|
|||
select_as_cta=request.form.get('select_as_cta') == 'true',
|
||||
start_time=utils.now_as_float(),
|
||||
tab_name=request.form.get('tab'),
|
||||
status=QueryStatus.PENDING if async else QueryStatus.RUNNING,
|
||||
sql_editor_id=request.form.get('sql_editor_id'),
|
||||
tmp_table_name=request.form.get('tmp_table_name'),
|
||||
user_id=int(g.user.get_id()),
|
||||
|
|
Loading…
Reference in New Issue