-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Rework findColumnIndexForColumnSetting to MLv2 #37854
Conversation
Codenotify: Notifying subscribers in CODENOTIFY files for diff 22684b8...5dbd7b5.
|
6917607
to
78f9b7b
Compare
|
2a2d026
to
63022e7
Compare
6f424bf
to
94a9dc2
Compare
* Add a comment why we can't use mlv2 in chart setting table * Use mlv2 findColumnIndexForColumnSetting in ChartSettingTableColumns * Tests completed, so revert throwing
* Use mlv2 findColumnIndexForColumnSetting in object detail * Address review
* Use mlv2 findColumnIndexForColumnSetting in Question * Update question tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
@@ -1,7 +1,9 @@ | |||
import cloneDeep from "lodash.clonedeep"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
structuredClone
didn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially jest didn't have it. After adding cljs started raising an error for cloned arrays (fieldRefs). We can actually use structuredClone on FE and map it to deepClone at jest
|
||
// before we fully migrate from Audit v1 | ||
// it's possible to have internal query here, which throws | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could check for internal queries like this
metabase/frontend/src/metabase/dashboard/components/DashCard/DashCardMenu/DashCardMenu.tsx
Line 159 in 2aa3cec
const isInternalQuery = InternalQuery.isDatasetQueryType( |
}: ObjectDetailProps) { | ||
const [currentObjectIndex, setCurrentObjectIndex] = useState(0); | ||
|
||
// only show modal if this object detail was triggered via an object detail zoom action | ||
const shouldShowModal = isObjectDetail; | ||
const getFallbackQuestion = () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know where question
is not passed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the idea of having a public question without permissions, so dataset query could be empty. I'll try to remove the fallback
@uladzimirdev Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
Closes #37677
This is an umbrella PR, other changes related to the problem will be merged here
Tasks
Description
Migrate
findColumnIndexForColumnSetting
to MLv2 with a fallback to the old method.Throwing an error is added to find all places where
query
is not passed, temporary