Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Jun 09, 2021
  2. Jun 08, 2021
    • Cam Saul's avatar
      Add helpers to define Settings with multiple impls (#16365) · c80be55d
      Cam Saul authored
      * Add helpers to define Settings with multiple impls
      
      * Add docstrings
      
      * Fix missing :require
      
      * Add namespace docstring per @dpsutton suggestion
      Unverified
      c80be55d
    • Howon Lee's avatar
      Friendly names bugfix 2 (#16482) · c00ffb45
      Howon Lee authored
      Friendly names bugfix 1 was a noop because of a typo in the WHERE clause of the DB migration. This one has been manually tested to go and sync on all 4 supported MB db's.
      Unverified
      c00ffb45
    • Cam Saul's avatar
      Post-merge fix :wrench: · 7cdbc59a
      Cam Saul authored
      7cdbc59a
    • Noah Moss's avatar
      Ignore unmapped groups during SSO group syncs (#16314) · d19be7f5
      Noah Moss authored
      * changes to sync-group-memberships! and unit tests
      
      * update jwt and saml code
      
      * fix admin sync tests
      
      * fix misplaced docstrings
      
      * address review comment
      Unverified
      d19be7f5
    • dpsutton's avatar
      Pass UTF8 as a literal into grouping by a bytes->temporal column (#16336) · d2433696
      dpsutton authored
      Repro:
      db setup:
      
      ```sql
      create table wut2 (t bytea, ts text);
      insert into wut2 (t, ts) values ('20210421164300'::bytea, '20210421164300');
      ```
      
      Mark t as :Coercion/YYYYMMDDHHMMSSBytes->Temporal, ts as
      :Coercion/YYYYMMDDHHMMSSString->Temporal
      
      Do a simple query, and then aggregate count by the two dates. ts
      should succeed and t fails.
      
      We are passing in the UTF8 as a parameter rather than just emitting a
      literal.
      
      Before:
      
      ```clojure
      {:sql
       "-- Metabase\nSELECT CAST(to_timestamp(convert_from(\"public\".\"wut\".\"t\", ?), 'YYYYMMDDHH24MISS') AS date) AS \"t\", count(*) AS \"count\" FROM \"public\".\"wut\" GROUP BY CAST(to_timestamp(convert_from(\"public\".\"wut\".\"t\", ?), 'YYYYMMDDHH24MISS') AS date) ORDER BY CAST(to_timestamp(convert_from(\"public\".\"wut\".\"t\", ?), 'YYYYMMDDHH24MISS') AS date) ASC",
       :params ("UTF8" "UTF8" "UTF8"),
       :type :invalid-query}
      ```
      
      After:
      
      ```sql
      SELECT CAST(to_timestamp(convert_from(\"public\".\"wut\".\"t\", 'UTF8'), 'YYYYMMDDHH24MISS') AS date) AS \"t\",
             count(*) AS \"count\" FROM \"public\".\"wut\"
      GROUP BY CAST(to_timestamp(convert_from(\"public\".\"wut\".\"t\", 'UTF8'), 'YYYYMMDDHH24MISS') AS date)
      ORDER BY CAST(to_timestamp(convert_from(\"public\".\"wut\".\"t\", 'UTF8'), 'YYYYMMDDHH24MISS') AS date) ASC
      ```
      
      Note there's a lot of extra casting that perhaps we can clean up
      Unverified
      d2433696
    • Gustavo Saiani's avatar
    • Howon Lee's avatar
      Detect if file is blank or bad for SQLite DB connection (#16372) · eb89b766
      Howon Lee authored
      Previously just used JDBC. However, JDBC will merrily execute queries on empty file locations for SQLite, because it'll create a new SQLite file. This one checks that there exists a SQLite file already to be querying in the first place
      Unverified
      eb89b766
    • Howon Lee's avatar
      DB Pagination Backend 11806 (#16346) · 6cad3473
      Howon Lee authored
      Folks wanted DB pagination in #11806 and apparently others but it didn't make it to notion. Well, it made it to my attention, anyhow, and here is some DB pagination, but just for the backend.
      Unverified
      6cad3473
    • Nemanja's avatar
      Fix test with old syntax · 68c8a198
      Nemanja authored
      68c8a198
    • Nemanja's avatar
      Merge branch 'master' into merge-x.39.3 · 9da8e0e3
      Nemanja authored
      9da8e0e3
  3. Jun 07, 2021
  4. Jun 04, 2021
  5. Jun 03, 2021
    • Noah Moss's avatar
    • Howon Lee's avatar
      Audit optimization for questions (#16220) · e8378db3
      Howon Lee authored
      
      Peeps want to make questions faster, but we don't give the data about query execution in a very user-friendly way. Here's it in a user-friendly way.
      
      Co-authored-by: default avatarAlexander Lesnenko <alxnddr@users.noreply.github.com>
      Unverified
      e8378db3
    • dpsutton's avatar
      Paginated collection metadata (#16275) · 8e3b4ad8
      dpsutton authored
      * Add the last-edit-info to the child query
      
      just for cards right now, need to extend to dashboards and then make
      sure we clean it up into the proper map.
      
      Have a set of all columns that are required and ensure those are in
      each query. Nulls need to be cast to the correct type if they aren't a
      text column (at least on postgres, need to investigate h2 and mysql).
      
      * Correct find last-edit-info for cards and dashboards
      
      * Move from group-by max id to self join
      
      * Paginate and search on collection items
      
      - include the metadata information in the query
        - to accomplish this, make a backstop to add all columns into each
          query
        - need types to union the null. in postgres it assumes all nulls are
          text. Haven't checked what mysql and h2 do here yet
      - sort_column: name, last_edited, model
      - sort_direction: asc, desc
      
      * Add default sort column and direction
      
      * handle mysql
      
      mysql doesn't need types on nulls to unify them
      
      * Correct batch post processing for cards and dashboards
      
      * Correct order of expectations
      
      they were alphabetical inside of models
      previous order:
      - acme products           | pulse
      - electro-magnetic pulse  | pulse
      - birthday card           | card
      - dine & Dashboard        | dashboard
      
      and is now ordered solely by name
      
      * Tests and sort on lower name after timestamp
      
      When sorting by last edited, lots of things don't have this, so don't
      want arbitrary sorting, but sort by name afterwards
      
      * Ensure nulls go to the end of the list
      
      * Tests
      
      * trying to make h2, mysql, and pg happy
      
      sorting timestamps and always having nulls last is quite difficult
      
      * Make diff bigger
      
      this was going in as a string and losing the timezone information, so
      was actually advancing time.
      
      Now: (java.time.OffsetDateTime/now)
      "2021-06-01T13:59:33.165483Z"
      
      Minus 2 hours: (.minusHours (java.time.OffsetDateTime/now) 2)
      "2021-06-01T11:59:27.528500Z"
      
      As seen in the code:
      ;; unaltered "now"
      "2021-06-01T08:55:28"
      ;; altered "two hours ago"
      "2021-06-01T11:55:29" <- UTC shenanigans. so just bump back 24 hours
      
      * Sort by model ranking
      
      * Remove clj-time and use ZonedDateTime instead of OffsetDateTime
      Unverified
      8e3b4ad8
    • Anton Kulyk's avatar
    • Ariya Hidayat's avatar
  6. Jun 02, 2021
  7. Jun 01, 2021
Loading