Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 26, 2021
  2. Aug 25, 2021
    • Ariya Hidayat's avatar
    • Cam Saul's avatar
      Block permissions backend (#17428) · bf2ba1f3
      Cam Saul authored
      * :no_entry: B L O C K :warning: permissions :white_check_mark:
      
      * Fix test failure in OSS since EE namespace doesn't exist.
      
      * Remove unused var
      
      * Oops, uncomment a commented-out test
      
      * Clean up the new perms documentation a bit
      bf2ba1f3
    • Ariya Hidayat's avatar
    • Noah Moss's avatar
    • Jeff Evans's avatar
      Update Presto JDBC lib version (#17591) · 0023987f
      Jeff Evans authored
      0.254 -> 0.260
      0023987f
    • Alexander Lesnenko's avatar
      5c3e84ec
    • Alexander Lesnenko's avatar
    • Alexander Polyankin's avatar
    • Anton Kulyk's avatar
      Fix run overlay not going away on GUI questions (#17590) · 548358a4
      Anton Kulyk authored
      * Enable repro tests
      
      * Don't sync stuctured questions on query complete
      548358a4
    • dpsutton's avatar
      User details on moderation review (#17482) · c8c984fe
      dpsutton authored
      ```bash
      
      % curl 'http://localhost:3000/api/card/760' -H <stuff omitted> | jq
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100  2003    0  2003    0     0   102k      0 --:--:-- --:--:-- --:--:--  102k
      {
        "description": null,
        "archived": false,
        "collection_position": null,
        "table_id": 2,
        "creator_id": 1,
        "moderation_reviews": [
          {
            "most_recent": true,
            "moderator_id": 1,
            "updated_at": "2021-08-16T21:30:00.665952Z",
            "status": "verified",
            "id": 1026,
            "user": {
              "email": "dan@metabase.com",
              "first_name": "dan",
              "last_login": "2021-08-10T21:17:35.366176Z",
              "is_qbnewb": false,
              "is_superuser": true,
              "id": 1,
              "last_name": "sutton",
              "date_joined": "2021-03-15T20:42:55.751834Z",
              "common_name": "dan sutton"
            },
            "moderated_item_id": 760,
            "created_at": "2021-08-16T21:30:00.665952Z",
            "moderated_item_type": "card",
            "text": null
          }
        ],
        "dataset_query": {
          "database": 1,
          "query": {
            "source-table": 2
          },
          "type": "query"
        },
        "id": 760,
        "display": "table",
        "last-edit-info": {
          "id": 1,
          "email": "dan@metabase.com",
          "first_name": "dan",
          "last_name": "sutton",
          "timestamp": "2021-05-12T22:04:57.205978Z"
        },
        ...
      }
      ```
      c8c984fe
    • dpsutton's avatar
      Effective type in result cols (#17533) · 32a0d6cb
      dpsutton authored
      * Include the results base type as the cols effective type
      
      previously was merged the effective type from the col which caused
      issues with dates when selecting a particular temporal unit, ie month.
      
      Queries like this return months as integers so the base and effective
      types are :type/Integer, and something somewhere else is responsible
      for the unit conversion of `1` to January (or feb, months get weird i
      think)
      
      ```clojure
      
      ;; after
      {:description "The date and time an order was submitted.",
       :unit :month-of-year,
       :name "CREATED_AT",
       :field_ref [:field 4 {:temporal-unit :month-of-year}],
       :effective_type :type/Integer, ;; we have the proper effective type
       :display_name "Created At",
       :base_type :type/Integer}
      
      ;; before:
      {:description "The date and time an order was submitted.",
       :unit :month-of-year,
       :name "CREATED_AT",
       :field_ref [:field 4 {:temporal-unit :month-of-year}],
       :effective_type :type/DateTime, ;; included effective type from db
       :display_name "Created At",
       :base_type :type/Integer}
      ```
      
      * tests
      
      * Driver tests
      
      * Ignore effective/base types in breakout tests
      
      sparksql is weird and its totally unrelated to the file under test
      
      * Use correct options for datetimes that are projected to month, etc
      
      When aggregating by a datetime column, you can choose a unit: month,
      hour-of-day, week, etc. You often (always?) end up with an
      integer. Previously the base_type was (inexplicably) :type/Integer and
      the effective_type was :type/DateTime which really just didn't make
      sense. The ideal solution is :type/DateTime as the base_type and
      :type/Integer as the effective_type. But this breaks the frontend as
      it expects to treat these columns in a special way. But it expected
      them to report as date columns.
      
      I've changed it only here. I thought about making isDate understand
      the `column.unit` attribute and recognize that these are in fact
      dates, but that seems wrong. These are integers that are special
      cases. It seems that the contexts that need to talk about dates should
      understand integers in a special way than all date code needs to be
      aware that integers might flow through.
      
      This might mean extra work but ultimately feels better as the correct
      solution.
      
      * unit is not default
      32a0d6cb
    • Nemanja Glumac's avatar
    • Anton Kulyk's avatar
      Update notebook editor's join step UI (#17523) · 79ea2d32
      Anton Kulyk authored
      * Move JoinStep's NotebookCell down to JoinClause
      
      * Break JoinClause into two NotebookCells
      
      * Update labels
      
      * Use `space` helper function
      
      * Simplify conditional statement
      
      * Fix not translated string
      79ea2d32
    • Alexander Polyankin's avatar
      5a79539e
  3. Aug 24, 2021
  4. Aug 23, 2021
    • Dalton's avatar
      enable default parameters to be unset on dashboards (#17522) · 3776db6c
      Dalton authored
      * enable unset default params on dashboard
      
      * add unit tests
      3776db6c
    • Gustavo Saiani's avatar
    • Nemanja Glumac's avatar
      Refactor `cy.editDashbardCard` Cypress custom command (#17560) · 35b272d8
      Nemanja Glumac authored
      * Update parameter names in `editDashboardCard` Cypress custom command
      
      * Update tests
      35b272d8
    • Howon Lee's avatar
      Mongo custom expressions (#17117) · eb25bc71
      Howon Lee authored
      Mongo custom expressions now are turned on for mongo 5.0 and after only. One idiosyncrasy is that we don't really support the BSON ID format at all in our typesystem despite having it in there, but both of my attempts to get them to work with the native mongo pipeline commands bounced because they really aren't strings, they're BSON ID's. We do rely on the pipeline commands heavily which is the reason for the version requirement.
      eb25bc71
    • Ariya Hidayat's avatar
    • Ariya Hidayat's avatar
      Add typing hints to `isa` to assist type inference (#17530) · 6d0bb151
      Ariya Hidayat authored
      This requires unfortunately an additional layer of indirection, however
      I believe it's super cheap and it shouldn't impact execution speed.
      
      In the mean time, many other predicates (isFoo etc) which rely on isa()
      will be correctly type-inferred, which gives a huge win for editing and
      debugging purposes.
      6d0bb151
    • Noah Moss's avatar
    • Nemanja Glumac's avatar
      #17551 Repro: Dashboard date filter "Include today" does not work for relative "Next" (#17557) · 538835f0
      Nemanja Glumac authored
      * Expand `setAdHocFilter` helper function to include current date
      
      * Add repro for #17551
      
      * Update test title
      538835f0
    • dpsutton's avatar
      Don't warn when running interpreted js (#17529) · d765d16d
      dpsutton authored
      I'm not sure we can fix this. We need the graal compiler which doesn't
      appear to be jdk 8 compatible but I can't actually find javadocs for
      it. Its not clear from
      https://github.com/oracle/graaljs/blob/master/docs/user/RunOnJDK.md
      how you can actually run it.
      
      I tried adding the graal compiler but that seems to assume you are in
      a graal vm and fails not finding a class.
      
      To get a list of all the options available for a context's engine,
      
      ```clojure
      (doto 'metabase.pulse.render.js-engine require in-ns)
      (map (comp (juxt :name :help) bean)
           (.getOptions (.getEngine (context))))
      ```
      
      I've done some profiling
      
      ```clojure
      (dotimes [_ 5]
        (time
         (do (let [rows [["apples" 2]
                         ["bananas" 3]]
                   colors {"apples" "red" "bananas" "yellow"}]
               (js-svg/categorical-donut rows colors))
             nil)))
      
      "Elapsed time: 210.32659 msecs"
      "Elapsed time: 193.211736 msecs"
      "Elapsed time: 190.97775 msecs"
      "Elapsed time: 195.843254 msecs"
      "Elapsed time: 188.077405 msecs"
      nil
      ```
      
      For interpreted and in another language, this doesn't seem the end of
      the world.
      
      And adding more quantities
      ```clojure
      (letfn [(rand-string [] (str/join "-" (repeatedly 4 #(rand-nth ["banana" "horse" "battery" "cloak"]))))]
        (dotimes [_ 5]
          (let [rows (repeatedly 20 (fn [] [(rand-string) (rand-int 100)]))
                colors (zipmap (map first rows) (cycle ["red" "green" "blue" "yellow"]))]
            (time
             (js-svg/categorical-donut rows colors)))))
      
      "Elapsed time: 288.659887 msecs"
      "Elapsed time: 334.733071 msecs"
      "Elapsed time: 317.369294 msecs"
      "Elapsed time: 272.084918 msecs"
      "Elapsed time: 272.7203 msecs"
      nil
      ```
      
      For a timeline line chart, rendering one datapoint per day for a whole
      year:
      
      ```clojure
      (dotimes [_ 5]
        (let [dates (take 365 (iterate #(.plusDays % 1) #t "2020"))
              rows   (map (fn [d] [d (rand-int 200)]) dates)
              labels {:left "count" :bottom "year"}]
          (time
           (js-svg/timelineseries-line rows labels))))
      
      "Elapsed time: 569.691124 msecs"
      "Elapsed time: 544.415676 msecs"
      "Elapsed time: 539.131092 msecs"
      "Elapsed time: 492.60486 msecs"
      "Elapsed time: 523.765691 msecs"
      nil
      ```
      d765d16d
Loading