Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Jun 21, 2022
  2. Jun 20, 2022
  3. Jun 18, 2022
  4. Jun 17, 2022
  5. Jun 16, 2022
    • Cal Herries's avatar
      Remove extra whitespace in defendpoint (#23350) · 90cb13cb
      Cal Herries authored
      
      * Remove extra whitespace in defendpoint
      
      * [ci nocache]
      
      Co-authored-by: default avatarLuis Paolini <paoliniluis@gmail.com>
      90cb13cb
    • dpsutton's avatar
      Handle quarters in native queries (#23368) · 3530241c
      dpsutton authored
      MBQL goes through a different path. This is only for native
      queries. Also the diff is huge. Ignoring whitespace shows a very modest
      diff:
      
      ```diff
          "month"   {:unit-range month-range
                     :to-period  t/months}
      +   "quarter" {:unit-range relative-quarter-range
      +              :to-period  (comp t/months (partial * 3))}
          "year"    {:unit-range year-range
                     :to-period  t/years}})
      
      ...
      
         "past2months~"   {:end "2016-06-30", :start "2016-04-01"}
         "past13months"   {:end "2016-05-31", :start "2015-05-01"}
      +  "past2quarters"  {:end "2016-03-31", :start "2015-10-01"}
      +  "past2quarters~" {:end "2016-06-30", :start "2015-10-01"}
         "past1years"     {:end "2015-12-31", :start "2015-01-01"}
         "past1years~"    {:end "2016-12-31", :start "2015-01-01"}
      ```
      
      Helpful Testing Strategies
      --------------------------
      
      Sample DB
      =========
      
      `select id, created_at from orders where {{created_at}}`
      and set a field filter of type "Date Filter"
      
      Custom Table
      ============
      
      Create a table that has entries in the middle of each quarter.
      
      ```sql
      esting=# create table quarters (id serial primary key not null, description text, t timestamptz);
      CREATE TABLE
      testing=# insert into quarters (description, t) values ('Q1 2022', '2022-02-01'), ('Q2 2022', '2022-05-01'), ('Q3 2022', '2022-08-01'), ('Q4 2022', '2022-11-01');
      INSERT 0 4
      testing=# select * from quarters;
       id | description |           t
      ----+-------------+------------------------
        1 | Q1 2022     | 2022-02-01 00:00:00-06
        2 | Q2 2022     | 2022-05-01 00:00:00-05
        3 | Q3 2022     | 2022-08-01 00:00:00-05
        4 | Q4 2022     | 2022-11-01 00:00:00-05
      (4 rows)
      ```
      
      Before this change
      ------------------
      
      > Cannot invoke "clojure.lang.IFn.invoke(Object)" because "to_period" is null
      
      (note, if you cannot reproduce this its because you haven't gotten
      https://github.com/metabase/metabase/pull/23346 in your local version
      which ensured errors always appear as errors on the frontend. java 11
      has no message for NPE so the Frontend missed it was an error and
      displayed no results as if the query had succeeded)
      
      This was the case for the following scenarios:
      - "last1quarters"
      - "last1quarters~"
      - "thisquarter"
      - "next1quarters"
      - "next1quarters~"
      
      where the ~ means to include the current quarter.
      
      After this change
      -----------------
      
      Running the queries against the custom table I made (current time is Jun
      15, Q2)
      
      - "last1quarters": "Q1 2022" "February 1, 2022, 6:00 AM"
      - "last1quarters~": "Q1 2022" "February 1, 2022, 6:00 AM" | "Q2 2022" "May 1, 2022, 5:00 AM"
      - "thisquarter": "Q2 2022" "May 1, 2022, 5:00 AM"
      - "next1quarters" "Q3 2022" "August 1, 2022, 5:00 AM"
      - "next1quarters~": "Q2 2022" "May 1, 2022, 5:00 AM" | "Q3 2022" "August 1, 2022, 5:00 AM"
      
      And of course added tests into the matrix for the date parsing.
      3530241c
    • jkeys089's avatar
      improved support for Google Cloud SQL (#19302) · e8368d1d
      jkeys089 authored
      
      * improved support for Google Cloud SQL
      
      * upgrade `postgres-socket-factory` and add license overrides
      
      * fix license check
      
      Co-authored-by: default avatarCam Saul <1455846+camsaul@users.noreply.github.com>
      e8368d1d
    • Braden Shepherdson's avatar
      9a2d06e5
    • Dalton's avatar
      Add NumberInputWidget component (#23247) · 78f2799b
      Dalton authored
      * First pass at NumberWidget
      
      * Share styled components
      
      * Remove TokenField prop for now
      
      * Second pass
      
      * Add to ParameterValueWidget
      
      * Add placeholder text
      
      * Rename to NumberInputWidget
      
      * Only use new widget for field filter parameters for now
      
      * Fix placeholder
      
      * Fix button text
      
      * Fix placeholder text
      
      * Add unit tests
      
      * Fix type
      78f2799b
    • Dalton's avatar
      Refactor card parameter utils (#23063) · 5bdde140
      Dalton authored
      Fix unit tests
      
      Update name to match dashboard util fn name
      5bdde140
    • Dalton's avatar
      Refactor `metabase/parameters/utils/dashboards` functions to be less coupled to Fields (#22964) · 219910fd
      Dalton authored
      * refactor dashboard utils
      
      Fix e2e test
      
      * rmv unused arg
      219910fd
Loading