Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Mar 28, 2023
  2. Oct 26, 2022
  3. Oct 05, 2022
  4. Jan 20, 2022
  5. Mar 04, 2021
    • Ariya Hidayat's avatar
      Remove type-checking with Flow (#14236) · f4d90f68
      Ariya Hidayat authored
      * yarn remove flow-bin eslint-plugin-flowtype
      
      * CI: remove fe-linter-flow
      
      * Remove Flow from ESLint config
      
      * Remove Flow type annotations and directives
      
      * Simplify Flow types for React elements and components
      
      * Import missing Flow types
      
      * Remove lint-flow from package.json
      Unverified
      f4d90f68
  6. Feb 25, 2021
    • Cam Saul's avatar
      MBQL Refactor: Combine various Field clauses into one new clause (#14897) · 6bdd5e09
      Cam Saul authored
      Background
      
      The original version of MBQL (known as the "Structured Query" language at the time, which was a little confusing) just referred to all fields by integer ID. e.g.
      
      {:filter ["STARTS_WITH" 1 "abc"]}
      That made clauses like this ambiguous:
      
      {:filter ["=" 1 2]} ; is 2 a Field, or the number 2?
      To clear up ambiguity and to let you filter Fields against Fields, we added the :field-id clause to make it explicit that you were referring to a Field, not an Integer:
      
      {:filter [:= [:field-id 1] [:field-id 2]]} ; Field 1 == Field 2
      We soon added a couple of new types of Field clauses, :fk-> and :datetime-field, both of which wrap the original :field-id:
      
      ;; refer to Field 2 from a different Table, use Field 1 from the current Table to perform the join
      [:fk-> [:field-id 1] [:field-id 2]]
      
      ;; bucket Field 3 by month
      [:datetime-field [:field 3] :month]
      So far things were still pretty reasonable, the worst you'd have to do is something like
      
      [:datetime-field [:fk-> [:field-id 1] [:field-id 2]] :month]
      Things started to get out-of-hand IMO when we continued to add more Field clause types that just wrapped everything else. We added :binning-strategy:
      
      [:binning-strategy <field> :num-buckets 10]
      then :field-literal, to refer to a Field from a nested native source query:
      
      [:field-literal "my_field" :type/Text]
      then we added :joined-field to specify the Table you're explicitly joining against that is the source of a Field:
      
      [:joined-field "my_join" [:field-id 4]]
      This ends up getting really hairy when you combine things. This is an actual real clause you can use right now:
      
      [:binning-strategy
       [:datetime-field
        [:joined-field "my_join"
         [:field-literal "my_field" :type/DateTimeWithLocalTZ]]
        :month]
       :num-bins 10]
      And even with all of those clauses, we still can't pass around arbitrary extra information in a way that would make it easy to implement performance optimizations. If we ever try to add another new clause, the whole house of cards is going to come crashing down.
      
      The proposal
      Combine all of the Field clauses into a single new :field clauses with the schema
      
      [:field id-or-name options-map]
      Here are some before & after examples:
      
      [:field-id 1] 
      => 
      [:field 1 nil]
      
      [:field-literal "my_field" :type/Text] 
      => 
      [:field "my_field" {:base-type :type/Text}]
      
      [:datetime-field [:field 1] :month] 
      => 
      [:field 1 {:temporal-unit :month}]
      
      [:binning-strategy [:field 1] :num-bins 10] 
      =>
      [:field 1 {:binning {:strategy :num-bins, :num-bins 10}}]
      
      [:joined-field "my_join" [:field 1]] 
      => 
      [:field 1 {:join-alias "my_join}]
      
      [:fk-> [:field 1] [:field 2]] 
      => 
      [:field 2 {:source-field 1}]
      
      [:binning-strategy
       [:datetime-field
        [:joined-field "my_join"
         [:field-literal "my_field" :type/DateTimeWithLocalTZ]]
        :month]
       :num-bins 10]
      =>
      [:field "my_field" {:base-type :type/DateTimeWithLocalTZ, :join-alias "my_join", :binning {:strategy :num-bins, :num-bins 10}}]
      Unverified
      6bdd5e09
  7. Oct 07, 2019
    • Tom Robinson's avatar
      Drill through fixes and cleanup (#11032) · f5b1e030
      Tom Robinson authored
      * Full support for all dimension types in expression editor (field-id, field-literal, fk->, joined-field, expression)
      
      * Fix various bugs in metabase-lib
      
      * Limit 'card-has-ambiguous-columns?' to native queries + use real DB id in composeThisQuery
      
      * Fix and add to tests
      
      * Swap Question constructor metadata/card args + misc other cleanup
      
      * Refactor and fix drill-throughs to support explicit joins etc
      
      * Misc FE metadata code cleanup (#11044)
      
      * Fix joined dimension options, e.x. custom field from a saved query
      
      * Cleanup schema_metadata and related method names
      
      * Use shorter aggregate/filter/breakout/sort/join methods everywhere
      
      * Add UnderlyingRecordsDrill tests
      Unverified
      f5b1e030
  8. Sep 18, 2019
    • Tom Robinson's avatar
      Fix drill through actions not working with joins (#10801) · 44e8d06f
      Tom Robinson authored
      * Fix drill through actions not working with joins
      
      * QuickFilterDrill unit test
      
      * Add Dimension and Field 'foreign' methods, fix Dimension and Field 'column' methods
      
      * Update sample dataset test fixtures with convienent aliases
      
      * More fixture cleanup
      
      * Fix lint and flow
      
      * more fixture cleanup
      
      * fix e2e test
      Unverified
      44e8d06f
  9. Aug 30, 2019
    • Tom Robinson's avatar
      Various frontend cleanup (#10450) · 5e8ff50d
      Tom Robinson authored
      * Remove .jsx extension from imports
      
      * Use color() function instead of colors[...]
      
      * Remove depreacted MBQL from frontned
      
      * Remove more deprecated MBQL
      
      * Revert a couple removals of .jsx due to flow conflict with .css files
      
      * Fix reference/utils tests
      
      * Fix color conflict
      5e8ff50d
  10. Jan 31, 2019
  11. May 07, 2018
Loading