Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Feb 24, 2023
  2. Feb 23, 2023
    • Cam Saul's avatar
      Snowflake Honey SQL 2 (#28478) · e3d817a4
      Cam Saul authored
      * Snowflake Honey SQL 2
      
      * Test fix :wrench:
      
      * Use Honey SQL 2 for GTAP compilation in sandboxing tests
      
      * Test fix :wrench:
      Unverified
      e3d817a4
    • Noah Moss's avatar
      Clojure migration to split v1 data perm paths into v2 data & query perms (#28350) · cde7ff70
      Noah Moss authored
      * new clojure migration for v1->v2 permissions
      
      * updates
      
      * fix rebase issue
      
      * fix reflection warning
      
      * fix final test and address comment about macro name
      
      * fix indentation
      
      * revert changes to defmigration macro to try to fix final test
      Unverified
      cde7ff70
    • Case Nelson's avatar
      Sqlite honey sql 2 (#28389) · 80ba6b1a
      Case Nelson authored
      * Convert sqlite driver to honey-sql-2
      
      * Fix bad case statement
      
      * We can't run native queries with AS for oracle
      
      * Dont call ->honeysql on a honeysql-expr
      
      * Fix bad call to h2x
      
      * Identifier needs to be wrapped
      
      * Update kondo config
      
      * Fix test
      
      * Remove hformat fn handler
      
      * Rotate the Snowflake DB prefix AGAIN
      
      * `sql.qp/format-honeysql` needs to wrap stuff in parens when generating SQL snippets
      
      * Update tests to match new expected SQL format
      
      * Sort namespaces
      
      * Fix the flaky paging test
      
      * Fix flaky `metabase.query-processor-test.timezones-test/filter-datetime-by-date-in-timezone-test`
      
      * MySQL test fix :wrench:
      
      
      
      * Try running Redshift with a beefier runner
      
      ---------
      
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Co-authored-by: default avatarCam Saul <1455846+camsaul@users.noreply.github.com>
      Unverified
      80ba6b1a
  3. Feb 22, 2023
  4. Feb 21, 2023
  5. Feb 20, 2023
    • Case Nelson's avatar
      Convert H2 driver to honey-sql-2 (#28273) · f827b28e
      Case Nelson authored
      
      * Fix linter
      
      * Make sure we're inlining num in substitution and sum aggregations
      
      * Set hsql version
      
      * Fixing tests
      
      * Fixing tests after the h2 conversion
      
      * Use h2x/extract in h2, fix test differences
      
      * Fixing tests for honeysql2
      
      * Only numbers get inlined
      
      * More test fixes
      
      * Fixing tests
      
      * Undo bad commit
      
      * Inline Ratio must produce doubles or h2 will do integer division where 1/2 = 0
      
      * Fix bad case statement
      
      * We can't run native queries with AS for oracle
      
      ---------
      
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Co-authored-by: default avatarCam Saul <1455846+camsaul@users.noreply.github.com>
      Unverified
      f827b28e
  6. Feb 17, 2023
  7. Feb 16, 2023
  8. Feb 14, 2023
    • Braden Shepherdson's avatar
      [metabase-lib] PoC for wrapping JS objects with cljs-bean in CLJC · 4c15f80c
      Braden Shepherdson authored
      A `metabase.domain-entities.malli/defn` macro that (in CLJS) uses the
      schemas for the arguments to drive wrapping of vanilla JS objects for
      idiomatic use in CLJC code.
      
      See the first two functions in `metabase.domain-entities.queries.util`
      which get passed vanilla JS objects but can use them as CLJS maps.
      4c15f80c
  9. Feb 13, 2023
    • Cam Saul's avatar
      Switch MySQL driver to Honey SQL 2 (#28176) · b820fa55
      Cam Saul authored
      * Support Honey SQL 2 for SQL QP
      
      * Sort namespace
      
      * Make Postgres/Redshift be Honey SQL 2-only
      
      * Test fix :wrench:
      
      * Fix busted
      
      * Redshift test fixes :wrench:
      
      * Sort namespaces
      
      * Fix Postgres convert_timezone
      
      * Fix linter config.
      
      * Switch MySQL driver to Honey SQL 2
      
      * Fix one last test failure
      
      * Redshift test fix
      
      * Test fixes and some extra validation etc.
      
      * Update common.clj
      
      * Update common.clj
      
      * Update common.clj
      
      * Add missing reflection warning
      
      * Add missing reflection warning
      
      * Use new namespace names
      
      * Fix a few things.
      
      * We should error on double-compilation of Honey SQL forms.
      
      * Fix a bunch of nonsense
      
      * Move Token features check fixes to a different branch
      
      * Test fixes
      
      * Fix double-compilation of raw forms
      
      * Test fix :wrench:
      
      * Test fix :wrench:
      
      * Eliminate unneeded casts
      
      * Fix syncing JSON table in MySQL 5.7
      
      * Don't error on sync for tests that are supposed to test sync error handling
      Unverified
      b820fa55
    • Bryan Maass's avatar
      update mu/defn kondo config 2 support lsp renaming (#27980) · 9ae71520
      Bryan Maass authored
      * update mu/defn kondo config 2 support lsp renaming
      
      * update mu/defn kondo config 2 support lsp renaming
      
      * add docstrings
      
      * fix linting error
      
      * fix "unused binding" error in test fxn
      
      * fix some calls to mu/defn
      Unverified
      9ae71520
  10. Feb 10, 2023
  11. Feb 09, 2023
  12. Feb 08, 2023
  13. Feb 07, 2023
  14. Feb 02, 2023
  15. Feb 01, 2023
  16. Jan 26, 2023
  17. Jan 23, 2023
  18. Jan 20, 2023
  19. Jan 19, 2023
  20. Jan 18, 2023
  21. Jan 13, 2023
    • Braden Shepherdson's avatar
      [metabase-lib] Port date and time parsing and formatting to CLJC (#27551) · 335d161f
      Braden Shepherdson authored
      This adds a cross-platform date/time formatting library in CLJC, with
      (nearly) identical output in both JVM and JS environments.
      
      The only known difference is week numbers.
      
      CLJS (through Moment.js) has ordinal numbers, and renders the week
      number as "34th". Neither the JVM nor Clojure has a handy library for
      this (I'm sure it's out there somewhere, but it seems like a silly
      dep to add) so it renders week numbers as simply "34".
      
      Both platforms have date formatters that use pattern strings (eg.
      `"YYYY-MM-dd"`) to turn date/time objects into strings. There's a strong
      resemblance in how these work and what letters stand for what parts of
      the date and time, but they are far from identical.
      
      Rather than try to hackily convert one set of strings to another with
      regexes or other manipulations, this PR defines a set of names for
      fragments of dates (eg. `:year`, `:day-of-week-full`, `:hour-24-dd`)
      and includes functions to transform a list of these keys into a
      platform-specific format function.
      
      This is portable and transparent, and can be written in Clojure or
      JS code:
      
      ```clj
      [:year "-" :month-dd "-" :day-of-month-dd]   ; 2022-04-08
      [:month-full " " :day-of-month-d ", " :year] ; April 8, 2022
      [:hour-12-dd ":" :minute-dd " " :am-pm]      ; 7:52 AM
      ```
      
      ```js
      [":year", "-", ":month-dd", "-", ":day-of-month-dd"]   ; 2022-04-08
      [":month-full", " ", ":day-of-month-d", ", ", ":year"] ; April 8, 2022
      [":hour-12-dd", ":", ":minute-dd", " ", ":am-pm"]      ; 7:52 AM
      ```
      
      Note that the original code allowed an unrecognized `:date-style` string
      to be used directly as the formatting string. With the move to
      formatting data structures that no longer works. Instead there is a
      fixed map of format strings to the above data structures, that contains
      all the currently used `:date-style` inputs.
      
      If some caller needs a new format someday, we can either: (a) add the
      style to the map; or (b) pass the data structure form directly to the
      `:date-format` option, which if provided is used as the format.
      
      It's tempting to go to all the call sites and replace these `:date-style`
      strings with the new format structures. However, the strings are still
      embedded in the `:visualization_settings` in user appDBs, so we still
      need to recognize them.
      
      Most of the existing functions in the TS library have the same API.
      
      The set of allowed `:date-style` and `:time-style` values is turned into
      a type using `keyof`, so that we get precise type-checking of these
      values rather than simply `string`.
      
      One function has been dropped from the API: `getDateFormatFromStyle`.
      There was no practical way to implement it using the new format data
      structures. The only caller was the date format column settings, and it
      has been rewritten to use the formatted string for its sample date as
      its key instead.
      Unverified
      335d161f
  22. Jan 11, 2023
  23. Jan 10, 2023
  24. Jan 05, 2023
  25. Jan 04, 2023
    • metamben's avatar
      Cherry pick be data apps minus apps and pages (#27413) · 3b8f0d88
      metamben authored
      
      * Implicit action pre-fetch values (#25940)
      
      * [Apps] Implicit action pre-fetch values
      
      WIP To return a parameter-id: value map in order to prefill ui.
      
      * Use jsonstring encoded parameters
      
      * Change parameters exposed by implicit actions
      
      Previously, we would look at a model's source-table to determine which
      parameters were valid for implicit actions. So if an implicit action is
      on a User model that hides the user.password column, you could still
      update or insert the password.
      
      With this commit, if the model doesn't expose a source table column, it
      is not a valid parameter. In the example user.password could not be
      inserted/updated or fetched for prefilling.
      
      * Fixing tests
      
      * Show data app page ID params in editing mode (#25943)
      
      * Data apps layout updates (#25930)
      
      * play with grid sizes to make apps feel appier [ci skip]
      
      * move app nav to bar inside app
      
      * only hide other header buttons outside of edit mode
      
      * tweak overflow issue
      
      * fix header width on data apps
      
      * add control to see app contents
      
      * set data apps layout constants contextually [ci skip]
      
      * remove hardcoded value [ci skip]
      
      * extract conextual header styles [ci skip]
      
      * set max-width on paramaters for data apps [ci skip]
      
      * move data apps nav deeper, only show if not editing [ci skip]
      
      * add spacing to contents trigger, rm old code [ci skip]
      
      * rm table thing for now [ci skip]
      
      * Fixes for data app layout updates (#25962)
      
      * Reorder import
      
      * Fix type
      
      * Fix missing translation, move out URL
      
      * Remove not used import
      
      * Rework `getSelectedItems` utility for data apps
      
      * Fix selected data app page highlighting
      
      * Don't reload app navbar on page change
      
      * Change nav item links look
      
      * Remove `DataAppPageSidebarLink`
      
      * Turn nav into HTML list
      
      * Use styled components
      
      * Fix edit button covered by visualizations
      
      * Fix opening homepage
      
      * Remove redundant prop
      
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      
      * First take at parameterized data app page titles (#25938)
      
      * Bring `DataAppContext` back
      
      * Pass `onFocus` and `onBlur` to `EditableText`
      
      * Export `EditableTextProps`
      
      * Add basic `DataAppPageTitle` component
      
      * Use `DataAppPageTitle`
      
      * Fix component name
      
      * Add primitive autocompletion to page title input
      
      * Add `title_template` to `DataAppNavItem` type
      
      * Tweak value management in `DataAppPageTitle`
      
      * Handle `null` values in titles more gracefully
      
      * Don't show suggestions without detail cards
      
      * Don't add whitespace when pasting a token
      
      * Don't update app's collection all the time
      
      * Add data app related selectors to dashboard selectors
      
      * Add redux state to keep title template changes
      
      * Update page title template on page save
      
      * Wire up `DataAppPageTitle` with dashboard code
      
      * Fix unit tests
      
      * Reset state on exiting editing mode
      
      * Add back button to template data picker
      
      * Fix test that didn't include pk on insert
      
      * Use the actual pk value
      
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      Co-authored-by: default avatarKyle Doherty <5248953+kdoh@users.noreply.github.com>
      
      * Revert "Remove data app permission code (#26016)"
      
      This reverts commit b8c92cf1.
      
      * Remove unused imports
      
      * Don't require the table_id on result_metadata elements (#26073)
      
      In some cases (which ones still has to be clarified) the result metadata doesn't
      contain the table_id and so no parameters are provided. In fact the table ID is
      probably not needed anyway because fields are already table specific.
      
      * Support filtering cards by used model (#26088)
      
      This change adds a new filter option for the GET /card endpoint.
      
      * Support filtering apps using a given model (#26124)
      
      * Handle type errors more cleanly (#26120)
      
      * [Apps] Handle type errors more cleanly
      
      Adds a number of tests for different db datatypes, these can be expanded
      on as we solve.
      
      Catches most exceptions during execution and logs then throws a generic
      message that leaks less of the details.
      
      * Make sure we order-by expected results
      
      * Fix tests, allow purposeful exception through
      
      * Accept model-ids for scaffolding apps (#26139)
      
      * [Apps] Accept model-ids for scaffolding apps
      
      WIP - accept model-ids but there's still some issues, might be able to
      start building UI from this point though.
      
      * Maybe working model
      
      * Work with card__n table-ids passed in. Fix problems with detail page
      
      * Dynamically add actions that exist on models
      
      * Update tests for existing custom actions
      
      * Can't def tru
      
      * Address review comments
      
      * Add required to action parameters (#26296)
      
      Looks at `database_required` field values for implicit actions, and
      `required` template-tags for custom query actions. Bubble those values
      up onto `action.parameters`. Finally, look at `requires_pk` to see if pk
      fields should be marked as required regardless.
      
      * Cleanup scaffolded back button (#26317)
      
      * Forward action execution error messages to the frontend (#26469)
      
      This is a crude temporary solution necessary to be able to debug problems related to executing actions.
      Although error parsing has been implemented for Postgres (only) with the goal to provide information for
      the FE like `{"errors":{"id":"violates foreign key constraint note_subject_id_fkey"}}`. This code doesn't
      care about the error message itself, it just forwards the error message from the DB to the FE.
      
      * Actions for public pages (#26554)
      
      * [Apps] Testing out public dashboards
      
      * Add WIP endpoints for public execution
      
      * Add throttle check to public execution route
      
      * Bump attempts-threshold to 1000
      
      * Bump threshold to 5000
      
      * Add test
      
      * Fix linter
      
      * Review changes
      
      * Fix lint
      
      * Run publicly shared actions with full permissions (#26610)
      
      * Support actions with MySQL and MariaDB (#26573)
      
      Support actions with MySQL/MariaDB
      
      * Check permissions for implicit actions (#26652)
      
      * Check permissions when executing implicit actions
      
      * Fix some action tests and reduce permissions boilerplate
      
      * Revert "[Apps] Disable data-apps prior to release (#25982)"
      
      This reverts commit 51147027.
      
      * WIP: Unify action representation (#26717) (#27349)
      
      * [Apps] WIP initial db migrations for giving implicit actions an action_id and removing card from query_action
      
      * Make crud work for http actions
      
      * Make implicit crud work
      
      * Rename implicit_action.namespace to kind. Rewrite merged-model-actions to actions-with-implicit-parameters
      
      * Fix query action creation
      
      * Make actions.test-util/with-action create a holding model
      
      * Fix unified-action-create-test
      
      * Fix get-action-test
      
      * Add tests for creating implicit and http dashcard actions
      
      * Enable query action in dashcard-action-create-update-test
      
      * Fix metabase.api.dashboard-test/dashcard-query-action-execution-test
      
      * Fix metabase.api.dashboard-test/dashcard-http-action-execution-test
      
      * Fix metabase.api.dashboard-test/dashcard-action-execution-auth-test
      
      * Fix metabase.api.dashboard-test/dashcard-action-execution-granular-auth-test
      
      * Make implicit action execution work
      
      * Scaffolding implicit actions from table
      
      * Fix metabase.api.action-test
      
      * Make scaffolding work with existing models. Update with-action macro to allow multiple actions
      
      * Fix metabase.api.public-test
      
      * Remove unused names from metabase.models.action
      
      * Remove some unused imports
      
      * Remove an unused import
      
      * Remove model_action and fix a bunch of tests
      
      * Fix dashcard-implicit-action-only-expose-and-allow-model-fields
      
      * Fix action type inheritance
      
      * Fill in remarks and add description to action
      
      * Add forward migration for existing actions and rollbacks that remove existing actions
      
      * Prevent overwriting parameters of custom actions
      
      * Support setting description on actions
      
      * Update migration to work with mysql - rollback is still not quite working in mysql due to database_id fk
      
      * Rename with-action macro to with-actions and document it
      
      * Remove report_card.is_write
      
      * Fix some more tests
      
      * Fix rollback across all appdb drivers, add not null constraints, use action.name to hold implicit slugs
      
      * Pull name and description from is_write card
      
      * Add name to scaffolded implicit actions
      
      * Remove ModelAction
      
      * Remove is_write from comments too
      
      * Different databases reference capture groups in regexp_replace differently. Also drop model_action table
      
      * Update migrations to pass linter.
      
      Introduce ${capturegroup.ref} to handle the different ways to reference
      capture groups within a regexp_replace. This allows collapsing large
      data migrations into a single `sql` element that the linter requires.
      
      * Add kind to action-mapper so we can sort as we wish
      
      * Add name to with-temp Action
      
      * Adjust FE to query actions migration (#26764)
      
      * Remove `is_write` card notion
      
      * Remove action `slug` from action types
      
      * Fix typo in `estimateCardSize` name
      
      * Remove hanging card's `is_write` prop
      
      * Remove not used writeback actions
      
      * Update endpoints
      
      * Remove not used prop
      
      * Remove action `slug` usage
      
      * Update actions entity
      
      * Tweak action creator to handle new actions shape
      
      * Fix saving action dashcards
      
      * Fix actions API usage
      
      How did that work before? :thinking:
      
      
      
      * Pass `database_id` when creating query actions
      
      * Remove custom list API implementation for actions
      
      * Clean up types
      
      Co-authored-by: default avatarTamás Benkő <tamas@metabase.com>
      
      * Change regexp_replace to substring to support mysql - this is ok because we have consistent json serialization.
      
      * Check permissions on the model in the action API
      
      * Remove unused required namespace
      
      * Throw an exception when demoting a model with actions to question
      
      * Allow saved parameters on implicit actions to add to implicit parameters
      
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      
      * empty commit to kick CI
      
      * bump CI
      
      * Fix down migrations
      
       change v45.00-002 sets up a fk fk_query_action_ref_action_id. h2 v2 for
       some strange reason requires us to remove the constraint before we can
       remove the primary key. But then we have to restore the state that
       v45.00-002 creates manualy
      
      * Allow for version for `(migrate! :down 45)`
      
      * Remove data apps parts not planned for 0.46
      
      Removed app container, app scaffolding and pages (dashboards with is_app_page)
      
      * Address linter issues
      
      * Make some cosmetic changes to reduce the diff
      
      * Make new permission API endpoints use defendpoint-schema
      
      * Fix bad automerge
      
      * Skip Mongo 4.2 instead of 4.0
      
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      Co-authored-by: default avatarKyle Doherty <5248953+kdoh@users.noreply.github.com>
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      Unverified
      3b8f0d88
  26. Jan 03, 2023
Loading