Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 25, 2021
    • 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
  2. Aug 24, 2021
  3. Aug 23, 2021
  4. Aug 21, 2021
  5. Aug 20, 2021
    • Jeff Evans's avatar
      Fix serialization P2 issues (#17388) · e8c7140a
      Jeff Evans authored
      * Fix serialization dump error when there are no collections
      
      Update `select-collections` to correctly handle the case where there are no collections
      
      Adding new test that removes all collections, then ensures that dump works with no errors
      
      * Fix serialization load error into empty/blank target DB
      
      Rethrowing exception in cmd when overall load fails
      
      Add test to ensure that a dump containing a user can be loaded into a blank target app DB successfully
      
      Adding a few missing bindings to the `with-temp-empty-app-db` code to set the connection vars under metabase.db.connection
      
      In upsert, add hooks for a :pre-insert-fn and :post-insert-fn to be invoked for new entity instances created by the upsert process, since whether an entity will be an insert or update isn't necessarily known by the load process (only by upsert once identity-condition is checked for each)
      
      In load, setting the pre and post insert functions for a User instance to initialize :password with a random value, and to generate and send a password reset email to the newly inserted user's email, respectively
      
      NOTE: this post insert fn (to send a password reset email for newly inserted users) is NOT hooked up for User as of x.41 release, since it is considered a bugfix, but this can be enabled in a future release)
      
      Adding new defs for the magic permission group names to make those easier to override from tests that might need to (such as the one added for this commit)
      
      * Fix serialization objects being incorrectly updated on skip
      
      Remove `maybe-fixup-card-template-ids!`, which was forcing mode :update, since the existing retry logic should cover what it was trying to do
      
      Update Card and Metric models to delete any Dependency instances for which they are the `:model_id` (to make serialization tests after other tests created temporary Card/Dependency pairs)
      
      Adding missing assertions for Dependency serialization
      
      * Serialization: Fix reload entity logic
      
      Now that the `:mode` is always respected instead of being ignored sometimes, we need to update our "second pass" reload functions to always make the mode `:update` on the second pass, or else that entity would just be skipped, which is bad
      
      Also updated the test to use `:mode` `:skip` from the beginning to be more stringent
      e8c7140a
    • Dalton's avatar
      refactor/move parameter object transformations to one place (#17461) · 02713dd3
      Dalton authored
      * refactor/move parameter object transformations to one place
      
      * use hasParameterValue in place of nil check
      
      * remove enableDefaultParameters arg since it is unused
      02713dd3
    • Gustavo Saiani's avatar
      c9bbfbc7
    • Jeff Evans's avatar
      New BigQuery Driver (#16746) · a980e085
      Jeff Evans authored
      New BigQuery Driver
      
      Create new :bigquery-cloud-sdk driver using the google-cloud-bigquery library instead, and whose source is adapted from the :bigquery driver
      
      https://cloud.google.com/bigquery/docs/reference/libraries
      
      Marking existing :bigquery driver as deprecated, and superseded-by the new one (bigquery-cloud-sdk)
      
      Update new driver and query processor code to use newer Google SDK
      
      Switch test data loading over to use new API
      
      Add project-id connection property to override the value from the service account JSON, and use it as part of qualified names in the query processor if set
      
      Updating google driver so its libraries are compatible with the newer ones used in BigQuery
      
      Update date bucketing tests to skip :bigquery-cloud-sdk (new driver) where :bigquery is skipped
      
      Update `with-bigquery-fks` to take in the driver, since there are now multiple ones
      
      Adding test to confirm that overriding project-id for a public BQ project works (sync and query)
      
      Fixing a bunch of whitespace alignment errors in tests
      a980e085
Loading