Skip to content

Commit

Permalink
Revert "Fix missing result metadata (#39201) (#39243)"
Browse files Browse the repository at this point in the history
This reverts commit ca5d0e2.
  • Loading branch information
kamilmielnik committed Feb 29, 2024
1 parent 8b4d608 commit 8ed689d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 82 deletions.
9 changes: 0 additions & 9 deletions e2e/support/helpers/e2e-misc-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ export function openNativeEditor({
return cy.findByTestId("native-query-editor").as(alias).should("be.visible");
}

export function focusNativeEditor() {
return cy
.findByTestId("native-query-editor")
.should("be.visible")
.should("have.class", "ace_editor")
.click()
.should("have.class", "ace_focus");
}

/**
* Executes native query and waits for the results to load.
* Makes sure that the question is not "dirty" after the query successfully ran.
Expand Down

This file was deleted.

11 changes: 2 additions & 9 deletions frontend/src/metabase/query_builder/actions/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import {
getCard,
getIsResultDirty,
getOriginalQuestion,
getParameters,
getQuestion,
getResultsMetadata,
getTransformedSeries,
isBasedOnExistingQuestion,
getParameters,
} from "../../selectors";
import { updateUrl } from "../navigation";
import { zoomInRow } from "../object-detail";
Expand Down Expand Up @@ -248,17 +248,10 @@ export const apiUpdateQuestion = (question, { rerunQuery } = {}) => {
const originalQuestion = getOriginalQuestion(getState());
question = question || getQuestion(getState());

let resultsMetadata = getResultsMetadata(getState());
const resultsMetadata = getResultsMetadata(getState());
const isResultDirty = getIsResultDirty(getState());

if (question.isDataset()) {
if (!resultsMetadata) {
// Running the question will populate results metadata in redux store.
// Without it getSubmittableQuestion won't have all the necessary information.
await dispatch(runQuestionQuery());
resultsMetadata = getResultsMetadata(getState());
}

resultsMetadata.columns = ModelIndexes.actions.cleanIndexFlags(
resultsMetadata.columns,
);
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/metabase/query_builder/actions/querying.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const runQuestionQuery = ({

const queryTimer = startTimer();

const runQuestionPromise = apiRunQuestionQuery(question, {
apiRunQuestionQuery(question, {
cancelDeferred: cancelQueryDeferred,
ignoreCache: ignoreCache,
isDirty: cardIsDirty,
Expand All @@ -140,8 +140,6 @@ export const runQuestionQuery = ({
.catch(error => dispatch(queryErrored(startTime, error)));

dispatch({ type: RUN_QUERY, payload: { cancelQueryDeferred } });

return runQuestionPromise;
};
};

Expand Down

0 comments on commit 8ed689d

Please sign in to comment.