Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sql lab): replace the output column in the query history table #19370

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const QueryHistory = ({
'progress',
'rows',
'sql',
'output',
'results',
'actions',
]}
queries={queries}
Expand Down
15 changes: 6 additions & 9 deletions superset-frontend/src/SqlLab/components/QueryTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ import ResultSet from '../ResultSet';
import HighlightedSql from '../HighlightedSql';
import { StaticPosition, verticalAlign, StyledTooltip } from './styles';

interface QueryTableQuery extends Omit<Query, 'state' | 'sql' | 'progress'> {
interface QueryTableQuery
extends Omit<Query, 'state' | 'sql' | 'progress' | 'results'> {
state?: Record<string, any>;
sql?: Record<string, any>;
progress?: Record<string, any>;
results?: Record<string, any>;
}

interface QueryTableProps {
Expand Down Expand Up @@ -227,12 +229,12 @@ const QueryTable = ({
</Card>
);
if (q.resultsKey) {
q.output = (
q.results = (
<ModalTrigger
className="ResultsModal"
triggerNode={
<Label type="info" className="pointer">
{t('View results')}
{t('View')}
</Label>
}
modalTitle={t('Data preview')}
Expand All @@ -252,13 +254,8 @@ const QueryTable = ({
responsive
/>
);
} else {
// if query was run using ctas and force_ctas_schema was set
// tempTable will have the schema
const schemaUsed =
q.ctas && q.tempTable && q.tempTable.includes('.') ? '' : q.schema;
q.output = [schemaUsed, q.tempTable].filter(v => v).join('.');
}

q.progress =
state === 'success' ? (
<ProgressBar
Expand Down