mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
fix(sql lab): display the 'View Results' button consistently in the history tab on sync mode (#19362)
* fix(sql lab): display the 'View Results' button in the history tab when running sync queries * pr comment
This commit is contained in:
parent
c8304a2821
commit
6d5d03e592
@ -247,9 +247,16 @@ export default class ResultSet extends React.PureComponent<
|
|||||||
this.clearQueryResults(nextProps.query),
|
this.clearQueryResults(nextProps.query),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only fetch results if the result key change
|
||||||
|
// If we didn't have a result key before, then the results are loaded elsewhere
|
||||||
|
// so we can skip it, unless the query id changed, in that case we should
|
||||||
|
// refetch regardless.
|
||||||
if (
|
if (
|
||||||
nextProps.query.resultsKey &&
|
(this.props.query.resultsKey &&
|
||||||
nextProps.query.resultsKey !== this.props.query.resultsKey
|
nextProps.query.resultsKey &&
|
||||||
|
nextProps.query.resultsKey !== this.props.query.resultsKey) ||
|
||||||
|
(nextProps.query.id !== this.props.query.id && nextProps.query.resultsKey)
|
||||||
) {
|
) {
|
||||||
this.fetchResults(nextProps.query);
|
this.fetchResults(nextProps.query);
|
||||||
}
|
}
|
||||||
|
@ -328,8 +328,10 @@ export default function sqlLabReducer(state = {}, action) {
|
|||||||
if (action.query.state === 'stopped') {
|
if (action.query.state === 'stopped') {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
const alts = {
|
const alts = {
|
||||||
endDttm: now(),
|
endDttm: now(),
|
||||||
|
resultsKey: action?.results?.query?.resultsKey,
|
||||||
progress: 100,
|
progress: 100,
|
||||||
results: action.results,
|
results: action.results,
|
||||||
rows: action?.results?.query?.rows || 0,
|
rows: action?.results?.query?.rows || 0,
|
||||||
|
@ -528,6 +528,8 @@ def execute_sql_statements( # pylint: disable=too-many-arguments, too-many-loca
|
|||||||
|
|
||||||
if store_results and results_backend:
|
if store_results and results_backend:
|
||||||
key = str(uuid.uuid4())
|
key = str(uuid.uuid4())
|
||||||
|
payload["query"]["resultsKey"] = key
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"Query %s: Storing results in results backend, key: %s", str(query_id), key
|
"Query %s: Storing results in results backend, key: %s", str(query_id), key
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user