-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Metabase - update runCardQuery endpoint #17717
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis update increments version numbers for several Metabase action components and the package, corrects the API endpoint used in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RunQueryAction
participant MetabaseApp
User->>RunQueryAction: Trigger Run Query action (with cardId, dashboardId, collectionPreview)
RunQueryAction->>MetabaseApp: Call runCardQuery({ cardId, dashboard_id, collection_preview })
MetabaseApp->>Metabase API: POST /card/{cardId}/query with payload
Metabase API-->>MetabaseApp: Return query results
MetabaseApp-->>RunQueryAction: Return results
RunQueryAction-->>User: Output results
Estimated code review effort2 (~15 minutes) Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/metabase/actions/create-dashboard/create-dashboard.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/metabase/actions/get-database/get-database.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/metabase/actions/get-dashboard/get-dashboard.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/metabase/package.json (1)
15-17: Pin @pipedream/platform dependency for deterministic buildsThe caret (
^3.1.0) allows any future 3.x release, which could introduce unintended breaking changes. Consider pinning to the exact version or updating the range only when intentionally upgrading.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
components/metabase/actions/create-dashboard/create-dashboard.mjs(1 hunks)components/metabase/actions/get-dashboard/get-dashboard.mjs(1 hunks)components/metabase/actions/get-database/get-database.mjs(1 hunks)components/metabase/actions/run-query/run-query.mjs(2 hunks)components/metabase/metabase.app.mjs(1 hunks)components/metabase/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
components/metabase/package.json (1)
Learnt from: jcortes
PR: #14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like fs to package.json dependencies, as they are native modules provided by the Node.js runtime.
components/metabase/actions/create-dashboard/create-dashboard.mjs (1)
Learnt from: jcortes
PR: #14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In components/gainsight_px/actions/create-account/create-account.mjs, the action name should be "Create Account" instead of "Create Memory".
components/metabase/actions/get-dashboard/get-dashboard.mjs (1)
Learnt from: jcortes
PR: #14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In components/gainsight_px/actions/create-account/create-account.mjs, the action name should be "Create Account" instead of "Create Memory".
components/metabase/actions/run-query/run-query.mjs (3)
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.
Learnt from: jcortes
PR: #14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In components/gainsight_px/actions/create-account/create-account.mjs, the action name should be "Create Account" instead of "Create Memory".
🧬 Code Graph Analysis (1)
components/metabase/actions/run-query/run-query.mjs (1)
components/metabase/actions/get-dashboard/get-dashboard.mjs (1)
response(24-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
🔇 Additional comments (9)
components/metabase/actions/get-database/get-database.mjs (1)
7-7: LGTM: Version increment aligns with coordinated package update.The version bump from "0.0.1" to "0.0.2" is consistent with the broader Metabase component updates in this PR.
components/metabase/metabase.app.mjs (1)
139-139: Approve: Endpoint path updated to/api/card/{id}/queryThis change aligns with the official Metabase API, which uses
/api/card/{id}/queryfor standard card queries (the/api/card/pivot/{id}/queryendpoint is reserved for pivot tables).• components/metabase/metabase.app.mjs – line 139: path now
/card/${cardId}/queryNo further action required.
components/metabase/actions/get-dashboard/get-dashboard.mjs (1)
7-7: LGTM: Consistent version update.Version increment aligns with the coordinated Metabase component updates.
components/metabase/actions/create-dashboard/create-dashboard.mjs (1)
8-8: LGTM: Version increment is consistent.The version update aligns with other Metabase action components in this PR.
components/metabase/actions/run-query/run-query.mjs (4)
6-6: Excellent: Description URL updated to match corrected endpoint.The documentation URL now correctly points to
/api/card/{card-id}/queryinstead of the previous pivot endpoint, aligning with the endpoint correction inmetabase.app.mjs.
7-7: LGTM: Version increment is consistent.Version update aligns with other Metabase action components.
23-35: Well-structured addition of optional properties.The new
dashboardIdandcollectionPreviewproperties are properly defined:
- Both are correctly marked as optional
dashboardIdreuses the existing propDefinition from the appcollectionPreviewhas appropriate type and descriptive labels- Consistent formatting and structure with existing properties
42-43: Proper implementation of new optional properties.The new properties are correctly:
- Destructured from the component instance
- Mapped to snake_case format (
dashboard_id,collection_preview) in the API payload- Passed to the
runCardQuerymethod consistently with existing patternsAlso applies to: 51-52
components/metabase/package.json (1)
3-3: All Metabase action versions are consistent
Every.mjsundercomponents/metabase/actionsis at version0.0.2—no mismatches found.
Resolves #17343
Summary by CodeRabbit
New Features
Bug Fixes
Chores