Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Mar 15, 2023
  2. Mar 14, 2023
    • Bryan Maass's avatar
      defendpoint auto coercion :gear: (#28929) · 3110b54d
      Bryan Maass authored
      * defendpoint auto coercion :arrow-heading-up::gear:
      
      * annotate all the id fields on the api with ms/Id
      
      * mark nillable "boolean"
      
      * update shape of action map
      
      - also improve the error messages with "recieved: _"
      
      * oh yeah! there are like 20 more *id*'s!
      
      * fix docstring + parse numbers properly
      
      * rename IntGreaterThanZero -> PositiveInt
      
      - remove ms/Id
      
      * fiddle with test wording
      
      * add regexes into compojure routes to avoid arbitrary route matching
      
      * tests for compojure route disambiguation w/ regex
      
      * trivial change to kick CI
      
      * minor refactor + update docstring
      
      * add nil condp default case
      
      * fix linter errors that snuck through .. somehow
      
      * fix typo + update tests that no longer regex-match
      3110b54d
    • Tim Macdonald's avatar
      Users can run actions if they have access to the database (#29088) · c46d7099
      Tim Macdonald authored
      * Users can execute actions if they can read the model and the DB is not blocked
      
      [Fixes #28425]
      c46d7099
    • Bryan Maass's avatar
      fix + api test (#29194) · 5a4dcc30
      Bryan Maass authored
      5a4dcc30
    • Cal Herries's avatar
      Optimize DB calls of dashboard card updates some more (#29132) · 32f291cf
      Cal Herries authored
      
      * Optimize average case DB calls
      
      * Typo
      
      * Fix test
      
      * Remove duplicate require
      
      * Return nil
      
      * Fixes
      
      * Fix docstring
      
      * Remove unused require
      
      * Avoid hydrating ordered_cards on the dashboard again
      
      * Tidy
      
      * Update docstring
      
      * Move transaction
      
      * Move comment
      
      * Remove dashboard->param-field-ids
      
      * whitespace
      
      * Tidy update-dashcards!
      
      * Updates from suggestions
      
      * Update test
      
      * Update test description
      
      Co-authored-by: default avatarNgoc Khuat <qn.khuat@gmail.com>
      
      ---------
      
      Co-authored-by: default avatarNgoc Khuat <qn.khuat@gmail.com>
      32f291cf
  3. Mar 13, 2023
  4. Mar 10, 2023
    • adam-james's avatar
      Improving axes grouping/splitting in static viz. (#28295) · 03fdddb8
      adam-james authored
      * WIP for better axes grouping in static viz.
      
      Double x-axis and single x-axis are different, but both can have situations where grouping might occur, so the
      implementation is a tad confusing. I'm trying to build test cases that represent both scenarios reasonably, and build
      an implementation that's not too confusing.
      
      * Fix reflection warnings in render test utils
      
      * Overlap calcs don't fail with BigDecimal inputs now.
      
      * Continuing to clean up overlaps calcs and impl for single/double in progress
      
      * WIP version that works for single-x multi-series and double-x multi
      
      There's a lot to think about here...
      
      But basically, handle rows of shape:
      
      double-x:
      
      [[x1 x2] [y]]
      
      and single-x:
      
      [[x] [y1 y2 y3]]
      
      * Single and Multi X axis now use same axes grouping strategy
      
      * Cover some overlap scoring cases.
      
      This may need improving in future still, but the overlap calculation is at least used for both single-x and multi-x
      axis scenarios now, which is a definitie improvement.
      
      * Missed these unused bindings in test let body
      
      * overlap calc won't fail if we pass in `[nil nil]`
      
      * Clean up grouping axes implementation addressing review feedback.
      
      - overlap and nearness split into two functions
      - add the fn 'axis-group-score' to call overlap/nearness appropriately, and handle condition checks (eg. nil vals)
      - removed old group-axes and now unnecessasry default-y-axis-pos fn -> handled by group-axes-at-once fn
      - axis group threshold not passed as arg anymore
      
      * Fixed some alignment mistakes
      03fdddb8
    • dpsutton's avatar
      List actions endpoint (#29055) · d2e893dd
      dpsutton authored
      
      * List all actions
      
      previously `api/action` required `?model-id=<model-id>`. This caused the
      FE to DOS the backend looping over each action. On stats I found 350 or
      so sequential requests, with app-db saturation leading to requests
      taking from 400ms near the beginning to 7seconds near the end.
      
      This makes `model-id` option and now returns actions on all models the
      user can see.
      
      ```
      ❯ http GET "localhost:3000/api/action" Cookie:$SESSION -pb
      [
          {
              "archived": false,
              "creator": {...},
              "creator_id": 1,
              "database_id": 3,
              "dataset_query": {...},
              "id": 1,
              "model_id": 1,
              "name": "source = foo",
              "parameter_mappings": null,
              "parameters": [...],
              ...
          }
          ...
      ]
      ```
      
      * update frontend for action picker to support single action list endpoint
      
      * list actions tests
      
      * update actions e2e tests
      
      * Return empty vector if no results
      
      Running tests locally might return some extra actions not asserted on in
      the tests. And there you might expect a 200. But CI runs with an empty
      database and returns no response so you get a 204. Quite annoying and
      there's no good way to expect a "2xx" status code at the moment. So just
      return the empty vector so it's always a 200 code.
      
      * update actions endpoint unit test mocks
      
      * Simplify logic a little
      
      * docstring tweak
      
      * schema with better error message
      
      * update mocks to accept optional modelId
      
      * simplify sorting and grouping
      
      * make sort case-insensitive
      
      * simplify action api test mocks
      
      ---------
      
      Co-authored-by: default avatarRyan Laurie <iethree@gmail.com>
      d2e893dd
    • dpsutton's avatar
      Handle models with joins (#29014) · 9d7d51f8
      dpsutton authored
      * Handle models with joins
      
      We had been using the metadata from the query to get column names, and
      then `select (column-names) from persisted-table`.
      
      But joins affect how columns are emitted.
      
      For this tests, using orders join to products, selecting order.total and
      product.category. And the metadata from running this query uses the
      normal names `:name "total"`, and `:name "category"`. _BUT_ the emitted
      sql does not use these names:
      
      ```sql
      SELECT "public"."orders"."total" AS "total",
             "products"."category" AS "products__category" -- <--------
      FROM "public"."orders"
      LEFT JOIN "public"."products" AS "products"
             ON "public"."orders"."product_id" = "products"."id"
      ```
      
      When we persist, we do `create table as <(qp/compile query)> so we were
      creating a column named `products__category` _NOT_ "category". But later
      on we would select "category" and this would blow up.
      
      ```sql
      select "total", "category" -- <- category doesn't exist in this table
      from "metabase_cache_424a9_8"."model_1105_txbhmkrnoy"
      ```
      
      Now a query of `{:source-table "card__<model-id>"}' emits the following
      query when the persisted cache is substituted:
      
      ```sql
      SELECT "source"."total" AS "total",
             "source"."products__category" AS "products__category"
      FROM (select * from "metabase_cache_424a9_8"."model_1152_lecqfzcjke") AS
      "source"
      LIMIT 1048575
      ```
      
      * Test and lint fixes
      9d7d51f8
    • Ngoc Khuat's avatar
      Exclude non required PKs from implicit create action (#29110) · 0b9acc66
      Ngoc Khuat authored
      * Exclude non-required PKs from implicit create actions
      0b9acc66
    • Ngoc Khuat's avatar
    • Ngoc Khuat's avatar
  5. Mar 09, 2023
    • Cam Saul's avatar
      MLv2 metadata calculation (#28921) · be66142d
      Cam Saul authored
      * MLv2 metadata overhaul, second try
      
      * Stricter linting for MLv2
      
      * Address PR feedback
      
      * Revert fancy fn schema for now
      
      * Remove unused import
      
      * Test fixes :wrench:
      
      * Oops fix bad :require form
      
      * MLv2 mega metadata overhaul 2 of infinity
      
      * Test fixes
      
      * Cljc humanization
      
      * Misc MLv2 improvements from #28921
      
      * Fix indentation
      
      * expression.non-integer-real
      
      * Remove debugging stuff
      
      * More cleanup
      
      * Add method for `:advanced`
      
      * non-integer-real
      
      * Test fixes :wrench:
      
      * Test fixes: ::ref/field shouldn't fail if checked against a non-sequential object
      
      * MLv2 `define-mbql-clause` and `type-of` calculation
      
      * Continued [ci skip]
      
      * MLv2 overhaul :flex:
      
      * Address PR feedback
      
      * Merge type-of overhaul
      
      * Address PR feedback
      be66142d
    • Cam Saul's avatar
      MLv2 clause and type determination overhaul (#29070) · 473758e3
      Cam Saul authored
      * MLv2 `define-mbql-clause` and `type-of` calculation
      
      * Continued [ci skip]
      
      * MLv2 overhaul :flex:
      473758e3
    • Mark Bastian's avatar
      Update snowplow-java-tracker dependency to 1.0.0 (#29042) · 44822a5a
      Mark Bastian authored
      Upgraded com.snowplowanalytics/snowplow-java-tracker from 0.12.0 to 1.0.0. This did require refactoring the `metabase.analytics.snowplow` ns to use the new fluent API as well as suppressing eastwood linting of the ns due to a classloader issue as described [here](https://github.com/jonase/eastwood/issues/444).
      44822a5a
    • john-metabase's avatar
      Serdes v2 namespace reorg (#29066) · e19ceeb4
      john-metabase authored
      * Reorganizes serdes v2 namespaces and some functions/multimethods to simplify implementation
      * Updates serdes v2 to store/load :serdes/meta in YAML to remove ingestion path matching
      e19ceeb4
    • Ngoc Khuat's avatar
    • dpsutton's avatar
      Remove personal collections from collection detail page (#28879) · 79824e47
      dpsutton authored
      * Remove personal collections from collection detail page
      
      https://github.com/metabase/metabase/pull/28023 Added "sub collections"
      to the collection detail page. Makes sense. The problem is that personal
      collections started appearing in this view. We have traditionally
      treated personal collections as siblings to the "Our Analytics" root of
      collections. So this was an impedence mismatch.
      
      This PR just removes all personal collections from the items returned
      from `"api/collection/root/items"`. The personal collection is still
      visible in the sidebar (returned from
      `api/collection/tree?tree=true&exclude-other-user-collections=true&exclude-archived=true`
      . Furthermore, all personal collections are still visible from the
      "three dots" menu on the sidebar.
      
      * poke ci
      
      * remove last personal collections from tests
      
      * e2e tests
      
      don't include a personal collection in the details page.
      
      * off by one from removing personal collections
      
      * Can't select personal collections if they aren't there
      79824e47
    • Cal Herries's avatar
    • Cal Herries's avatar
      Remove unnecessary `retrieve-dashboard-card` call on every update to a dashcard (#29037) · da422ca4
      Cal Herries authored
      * Remove retrieve-dashboard-card call
      
      * Have `update-dashboard-card!` return nil, not true
      da422ca4
  6. Mar 08, 2023
    • Cam Saul's avatar
      Misc MLv2 improvements from #28921 (#29010) · dac6d4dd
      Cam Saul authored
      * MLv2 metadata overhaul, second try
      
      * Stricter linting for MLv2
      
      * Address PR feedback
      
      * Revert fancy fn schema for now
      
      * Remove unused import
      
      * Test fixes :wrench:
      
      * Oops fix bad :require form
      
      * Misc MLv2 improvements from #28921
      
      * Fix indentation
      
      * expression.non-integer-real
      
      * Remove debugging stuff
      
      * More cleanup
      
      * Test fixes: ::ref/field shouldn't fail if checked against a non-sequential object
      dac6d4dd
    • metamben's avatar
      MLv2 filter schema (#28912) · 59a19c30
      metamben authored
      * Make nil equality comparable
      * Add Malli schema for filter expressions
      59a19c30
  7. Mar 07, 2023
    • Cam Saul's avatar
      MLv2 metadata overhaul 1 of ∞ (#28881) · 72a66c29
      Cam Saul authored
      * MLv2 metadata overhaul, second try
      
      * Stricter linting for MLv2
      
      * Address PR feedback
      72a66c29
    • Noah Moss's avatar
      Bind *card-id* when executing a dashboard subscription to fix perm checks (#28961) · c9a95893
      Noah Moss authored
      * bind *card-id* when executing a dashboard subscription so that perm checks work properly
      
      * refactor & address test comment
      
      * fix spacing
      
      * unskip repro that this also fixes
      c9a95893
    • Noah Moss's avatar
      0c6859e7
    • dpsutton's avatar
      Fix flaky test and test for a new case (#28757) · cc4601b1
      dpsutton authored
      
      * Fix flaky test and test for a new case
      
      flaky test was annoying. It would timeout after 45 seconds. And
      annoyingly, it times out on the _client_, not the server. So we don't
      get the proper error message we expect.
      
      And what's happening is that the backend just hooks up the pipe from
      it's request to the response. And if no bytes ever come across, we just
      twiddle our thumbs until the http request in the test gives up.
      
      The only reliable way i could think of to fix this is to spin up a
      webserver that just accepts and then ignores requests (which is what
      github did to us in the flaky test).
      
      Had to bump the ring adapter to get the newly exposed `:async-timeout
      60000` parameter. By default the webserver in the test has a timeout of
      30 seconds, which is shorter than the 45 second timeout for the test's
      request to the geojson endpoint.
      
      * add comment
      
      * clean up test server logic
      
      ---------
      
      Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
      cc4601b1
  8. Mar 06, 2023
    • Cam Saul's avatar
      Clean up... · a90fff13
      Cam Saul authored
      Clean up `metabase.query-processor-test.timezones-test/filter-datetime-by-date-in-timezone-test`  (#28474)
      
      * Get more info about flaky presto test failures
      
      * Include testing context
      
      * Fix flaky test
      a90fff13
  9. Mar 04, 2023
    • Case Nelson's avatar
      Cannot use filter relative interval on breakout fields (#28799) · c79dcc7f
      Case Nelson authored
      Fixes #25378
      
      When using a relative filter with a starting from n units ago on an
      aggregation with the same units, we were incorrectly assuming that we
      would be working with a field ref at the top level. However, in this
      scenario the field is nested such as `[:+ [:field $created_at
      {:temporal-unit :month}] [:interval 1 :month]]`. This change makes sure
      that we are altering the field-ref.
      c79dcc7f
  10. Mar 03, 2023
  11. Mar 02, 2023
Loading