Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Dec 13, 2022
  2. Dec 12, 2022
  3. Dec 09, 2022
  4. Dec 08, 2022
    • Cam Saul's avatar
      Add `=?` test expression type (#23982) · 43236c0a
      Cam Saul authored
      
      * ≈ [WIP] [ci skip]
      
      * Minor cleanup [ci skip]
      
      * Code cleanup. [ci skip]
      
      * Kondo in CI should fetch library configs
      
      * Bump Methodical version
      
      * Change name to `=?`
      
      * Add `#exactly` reader tag
      
      * Add `#schema` data reader
      
      * Fix dev deps indentation and add `algo.generic`
      
      * Add `approx=`
      
      * Improved version of `#approx`
      
      * Just check in third party Kondo config for now instead of fighting CI
      
      * Update test/metabase/test_runner/assert_exprs/approximately_equal_test.clj
      
      Co-authored-by: default avatarTim Macdonald <tim@metabase.com>
      
      * Address PR feedback and fix sequence comparison
      
      Co-authored-by: default avatarTim Macdonald <tim@metabase.com>
      43236c0a
    • Cam Saul's avatar
      Add import and export (SerDes v2) commands (#26984) · 3d5ddd9c
      Cam Saul authored
      * Add import and export (SerDes v2) commands
      
      * Allow use of deprecated dump/load in EE tests
      3d5ddd9c
    • metamben's avatar
      Store DBMS version in Database (#26983) · f4901387
      metamben authored
      * Store DBMS version in Database
      * Add DBMS version to anonymous stats
      * Add dbms_version sync tests
      * Add test for DBMS versions in anonymous stats
      f4901387
    • Bryan Maass's avatar
      only query for db-metadata once per sync operation + scan each table for its PKs (#26810) · d3a98472
      Bryan Maass authored
      * memoize snowflake describe-database w/ 5 min ttl
      
      * pass in db-metadata where it is used,
      
      - rather than querying for it in random functions
      
      * update callsite of sync-tables-and-database!
      
      * let sync-metabase-metadata! look up db-metadata
      
      - only when needed
      
      * pass catalog (db), and schema to .getPrimaryKeys
      
      * let describe-table* add in the nil table-name
      
      * cleanup
      
      * use :snowflake instead of driver for inheritance
      
      * concurrent-sync-test should call describe-database once
      
      * cleaning up
      
      * call add-table-pks with 3 args
      
      * call add-table-pks with 3 args
      
      * try escaping entity names to appease Oracle Driver
      
      - Oracle wants the table-name to be escaped
      - escape is usually a no-op
      
      * pass driver to escape entity
      
      * pull get-table-pks into a multimethod,
      
      - handle the discrepancy directly in Oracle driver
      
      * remove inline def
      
      * fix colliding consistent-namespace linting
      
      - metabase.driver.sql-jdbc.common and
        metabase.driver.sql-jdbc.sync.common were
        mapped to sql-jdbc.common
      - metabase.driver.sql-jdbc.sync.common is now
        mapped to sql-jdbc.sync.common
      
      * fix reflection warnings
      
      * apply fix for getting oracle pks
      
      * nix an unused arg
      d3a98472
    • Cam Saul's avatar
      Support standard deviation aggregations for MongoDB (#27025) · c39f17fe
      Cam Saul authored
      * MongoDB test data config should not hardcode the user and password we use in CI
      
      * Minor test data interface dox improvements
      
      * Support standard deviation and variance for MongoDB
      
      * Oops I got :expressions mixed up with :expression-aggregations
      
      * Note about calculating variance
      
      * `connection-type` instead of `db-or-server`
      c39f17fe
    • Ngoc Khuat's avatar
      c73570ff
    • Cal Herries's avatar
      datetime-diff function for SQL Server (#27002) · dc746c4e
      Cal Herries authored
      * Remove hard-coded drivers from datetime-diff-type-test
      
      * Add requirement for set-timezone for datetime-time-zones-test
      
      * Add sqlserver implementation
      
      * Change datetime-diff-time-zones-test to test drivers that don't support set-timezone
      
      * Refactor
      
      * Temporarily remove snowflake from datetime-diff-type-test
      dc746c4e
    • Cal Herries's avatar
      Fix incorrect parens (#27033) · 1875fede
      Cal Herries authored
      1875fede
  5. Dec 07, 2022
    • dpsutton's avatar
      Fix numeric parameter values in jwt (#26969) · f342fe17
      dpsutton authored
      * Fix numeric parameter values in jwt
      
      Don't call `seq` on numbers. If its a string, assert it isn't blank,
      otherwise check that it is non-null.
      
      * bind (:value request-param)
      f342fe17
    • dpsutton's avatar
      Fix flaky `remap-human-readable-string-column-test` (#27050) · b43eaf7e
      dpsutton authored
      * Fix flaky `remap-human-readable-string-column-test`
      
      Quite annoying test that would flake quite a bit in CI.
      
      the problem is that the mechanism for `mt/with-column-remappings` wasn't
      aware of the case when there were pre-existing mappings. It just blindly
      added a new mapping. But when the middleware fetching the remappings, it
      found the preexisting ones.
      
      For the venue.name field in this test, that was ("20th Century
      Cafe","25°","33 Taps","800 Degrees Neapolitan Pizzeria", ...). We were
      passing in fake names like "apple", "banana", "kiwi" and it found no
      remappings for those in the db.
      
      So the fix is to check for pre-existing ones, and if found, use
      `tu/with-temp-vals-in-db` to temporarily set them to the desired values,
      otherwise use some new ones with `tt/with-temp*` as it was doing
      previously.
      
      * log errors for CI
      
      * Only use type :full field values when remapping
      
      we store cached chained filter values in here (with type :linked-filter,
      there are also type :sandbox in there) but the :full are the ones that
      are used for remapping.
      
      In the tests, if the chain link tests have already run, there can be 6
      field values for the field here (`(mt/id :venues :name)`) and we want to
      make sure we update the full one, not the chain filter ones
      
      ```clojure
      [{:hash_key "576275248",
        :has_more_values false,
        :last_used_at #t "2022-12-07T21:08:35.592931Z",
        :type :linked-filter,
        :updated_at #t "2022-12-07T21:10:22.972907Z",
        :human_readable_values
        ("Appletini" "Bananasplit" "Kiwi-flavored Thing"), ;; the test updatedthe existing :linked-filter one
        :id 560,
        :values ("apple" "banana" "kiwi"),
        :field_id 15,
        :created_at #t "2022-12-07T21:08:35.592931Z"}
       {:hash_key "-897793959",
        :has_more_values false,
        :last_used_at #t "2022-12-07T21:08:35.695344Z",
        :type :linked-filter,
        :updated_at #t "2022-12-07T21:08:35.695344Z",
        :human_readable_values [],
        :id 564,
        :values ("Kinaree Thai Bistro" "Krua Siri"),
        :field_id 15,
        :created_at #t "2022-12-07T21:08:35.695344Z"}
       {:hash_key "388078290",
        :has_more_values false,
        :last_used_at #t "2022-12-07T21:08:35.742561Z",
        :type :linked-filter,
        :updated_at #t "2022-12-07T21:08:35.742561Z",
        :human_readable_values [],
        :id 566,
        :values ("Tacos Villa Corona" "Tito's Tacos"),
        :field_id 15,
        :created_at #t "2022-12-07T21:08:35.742561Z"}
       {:hash_key "-299897589",
        :has_more_values false,
        :last_used_at #t "2022-12-07T21:08:35.777517Z",
        :type :linked-filter,
        :updated_at #t "2022-12-07T21:08:35.777517Z",
        :human_readable_values [],
        :id 567,
        :values ("Festa" "Fred 62"),
        :field_id 15,
        :created_at #t "2022-12-07T21:08:35.777517Z"}
       {:hash_key "-391654650",
        :has_more_values false,
        :last_used_at #t "2022-12-07T21:08:36.681046Z",
        :type :linked-filter,
        :updated_at #t "2022-12-07T21:08:36.681046Z",
        :human_readable_values [],
        :id 569,
        :values ("Baby Blues BBQ" "Beachwood BBQ & Brewing" "Bludso's BBQ"),
        :field_id 15,
        :created_at #t "2022-12-07T21:08:36.681046Z"}
       {:hash_key "1784886858",
        :has_more_values false,
        :last_used_at #t "2022-12-07T21:08:36.860010Z",
        :type :linked-filter,
        :updated_at #t "2022-12-07T21:08:36.860010Z",
        :human_readable_values [],
        :id 572,
        :values ("Baby Blues BBQ" "Beachwood BBQ & Brewing" "Bludso's BBQ"),
        :field_id 15,
        :created_at #t "2022-12-07T21:08:36.860010Z"}
       {:hash_key nil,
        :has_more_values false,
        :last_used_at #t "2022-12-07T21:04:04.299251Z",
        :type :full, ;; but should have updated this one
        :updated_at #t "2022-12-07T21:04:04.299251Z",
        :human_readable_values [],
        :id 4,
        :values
        ("20th Century Cafe"
         "25°"
         "33 Taps"
         "800 Degrees Neapolitan Pizzeria"
         "BCD Tofu House"),
        :field_id 15,
        :created_at #t "2022-12-07T20:57:21.896298Z"}]
      ```
      
      * remove CI logging
      b43eaf7e
    • Cal Herries's avatar
      datetime-diff function for snowflake (#26746) · c328eb1b
      Cal Herries authored
      * Add snowflake datetime-diff implementation
      
      * Get timestamps without timezones or offsets working
      
      * Convert to timestamp_tz, not timestamp
      
      * Format rows in tests
      
      * Fix snowflake set-parameter
      
      * Add failing tests
      
      * Fix bigquery
      
      * Formatting
      
      * Replace literals for datetime-diff-time-zones-test
      
      * Revert "Fix snowflake set-parameter"
      
      This reverts commit c24348a436f3f0f2639a12d6ea368399d1549739.
      
      * Actually use fields
      
      * Fix typo
      
      * Rename dataset
      
      * Add type/DateTimeWithTZ column, since redshift doesn't like type/DateTimeWithZoneOffset
      
      * Fix snowflake for time zones
      
      * Undo changes to extract and date-trunc
      
      * Explicitly set UTC timezone
      
      * Fix mismatched types
      
      * Remove redundant bindings
      
      * Remove redundant comment
      
      * Add failing tests
      
      * Remove duplicate dataset
      c328eb1b
  6. Dec 06, 2022
  7. Dec 05, 2022
  8. Dec 02, 2022
  9. Dec 01, 2022
    • Mahatthana (Kelvin) Nomsawadi's avatar
      Respect chart orders in static viz (#26797) · 95bc8834
      Mahatthana (Kelvin) Nomsawadi authored
      
      * Refactor so static combo chart is ready for reordering
      
      * Correct test names
      
      * Clean up static viz combo chart BE API
      
      * sort static combo chart
      
      * Order static funnel chart
      
      * Remove unused import and function
      
      * Fix BE tests
      
      * Remove custom column name tests since logic is moved to FE
      
      * Remove graph.series_order when changing dimensions (#26842)
      
      * review
      
      Co-authored-by: default avatarNick Fitzpatrick <nick@metabase.com>
      Co-authored-by: default avatarAleksandr Lesnenko <alxnddr@gmail.com>
      95bc8834
    • Cal Herries's avatar
      now function (#26548) · fe0b8e90
      Cal Herries authored
      
      * Implement now for sql drivers
      
      * Remove unused import
      
      * Add tests
      
      * Add more tests
      
      * Implement bigquery, mysql, postgres
      
      * Test now as argument
      
      * Fix FE type inferencer
      
      * Change feature flag to date-arithmetics
      
      * Implement h2 driver
      
      * Fix tests for sqlite
      
      * Add snowflake implementation
      
      * Remove type test
      
      * Fix test for sqlite
      
      * Update how we handle autocomplete and format for zero-arity functions in ExpressionEditor (#26563)
      
      * Update suggestionText function
      
      * Suggest with closing parens if zero-arity
      
      * Format zero-arity functions with ()
      
      * Refactor formatFunction
      
      * Remove unused imports
      
      * Add presto implementation
      
      * Add sqlserver implementation
      
      * Test in multiple timezones
      
      * Remove setting test driver
      
      * Add sparksql implementation
      
      * Fix count() fe unit test
      
      * Add fe MBQL unit test for now()
      
      * Fix sparksql implementation
      
      * Add vertica implementation
      
      * Add oracle implementation
      
      * Add vertica implementation
      
      * Remove accidental form
      
      * Fix vertica implementation for report timezones
      
      * Remove unused multimethod
      
      * Remove unused feature
      
      * Update sparksql
      
      * Fix fe unit tests
      
      * Fix fe unit tests
      
      * Update hive implementation
      
      * Revert "Fix fe unit tests"
      
      This reverts commit fde4dd0d.
      
      * Revert "Fix fe unit tests"
      
      This reverts commit 7b7429ea.
      
      * Revert "Fix count() fe unit test"
      
      This reverts commit c5c6f6f9.
      
      * Revert "Refactor formatFunction"
      
      This reverts commit ac50e73e.
      
      * Revert "Update how we handle autocomplete and format for zero-arity functions in ExpressionEditor (#26563)"
      
      This reverts commit cf39634e.
      
      * Update hive
      
      * snowflake: convert type to timestamptz
      
      * sqlserver: rename date-trunc to zeroed-date-part
      
      * Wrap with database type info
      
      * Change fe unit test back to now without parens
      
      * Change MBQL clauses config for now to return type "datetime"
      
      * Fix presto
      
      * Add some fe unit tests for parsing and resolving
      
      * Update helper-text-strings
      
      * Change from second to millisecond precision
      
      * Remove test for second precision
      
      * presto: Change from second to millisecond precision
      
      * vertica: Change from second to millisecond precision
      
      * vertica: Change from second to millisecond precision
      
      * Change feature flag from date-arithmetics to now
      
      * Change feature flag from date-arithmetics to now, mbql schema
      
      * Allow now to be used in filter clauses
      
      * Add test for filter
      
      * Implement driver/database-supports? for each driver that implements :now
      
      * Tidy tests
      
      * Add back default sql implementation
      
      * Add sqlite feature flag
      
      * Add mongo implementation
      
      * Fix mongo
      
      * Format rows
      
      * Change vertica to return timestamp with time zone
      
      * Fix presto tests
      
      * Remove unused require
      
      * Update h2 function to return timestamp with time zone
      
      * mongo: calculate now during query execution, not processing, for versions >=4.2 (#26822)
      
      * replace with $$NOW
      
      * Remove unused import
      
      * Add back previous now implementation for versions <4.2
      
      * Throw an error if version is <4.2
      
      * Add i18n
      
      * Ignore patch version
      
      * Clean up `SchedulePicker` component (#26839)
      
      * Move `SchedulePicker` to its own directory
      
      * Sort imports
      
      * Do basic clean up
      
      * Extract `DEFAULT_DAY` to a constant
      
      * Extract styled components
      
      * Convert `SchedulePicker` to TypeScript
      
      * Add `SchedulePicker` container
      
      * Export `SchedulePicker` options
      
      * Add basic `SchedulePicker` story
      
      * Fix `SchedulePicker` crashes Storybook
      
      * Tweak Storybook file
      
      * Build datetime filters as datetime before question is saved (#26679)
      
      * Revert "Update h2 function to return timestamp with time zone"
      
      This reverts commit f7cce3ea7ccbbfc886d0942d66b1f8f60feb6aba.
      
      Co-authored-by: default avatarGustavo Saiani <gus@metabase.com>
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      fe0b8e90
    • Noah Moss's avatar
      Extract sample DB to plugins directory on startup (#26828) · 726b659f
      Noah Moss authored
      * initial implementation
      
      * some refactor and improved error handling
      
      * another refactor
      
      * fix reflection warning
      
      * add test and more refactor
      
      * another test
      
      * misc comment improvements and formatting
      
      * fix tests
      
      * small refactor
      
      * fix function call
      
      * address tamas's comments
      726b659f
    • Ngoc Khuat's avatar
      Convert-timezone for bigquery, snowflake, redshift (#26633) · 71229ac5
      Ngoc Khuat authored
      * Bigquery
      
      * Redshift
      
      * Snowflake
      
      * no convert-timezone for sparksql because it only has one timestamp data type
      
      * redshift -- wrap type when adding interval
      
      * don't override results-timezone-id in tests
      
      * fix redshift ignore timezone when insert timestamp with time zone test data
      71229ac5
    • Ngoc Khuat's avatar
      Make sure the new datetime functions work with literal (#26706) · 8a49c283
      Ngoc Khuat authored
      * datetime-add, datetime-subtract, temporal-extract, convert-timezone now can takes datetime literal as argument
      
      * fix vertica
      8a49c283
  10. Nov 30, 2022
  11. Nov 29, 2022
    • Cam Saul's avatar
      Athena driver (#26301) · a32bb77b
      Cam Saul authored
      * Include Amazon Athena support for dacort/metabase-athena-driver
      
      * Use Metabase Maven repo to fetch Athena driver
      
      * Copy test extensions from Damon's Athena driver repo
      
      * Some code cleanup.
      
      * Move namespaces => metabase.driver.athena
      
      * Clean up the test extensions namespace
      
      * 42 failures, 16 errors
      
      * Fix regex support; disable a few tests
      
      * Minor tweaks
      
      * Fix data-source-name
      
      * Fix :week and :day-of-week impls (mostly): 2 failures, 3 errors
      
      * Fix OFFSET, :week-of-year; skip test that has TIME column
      
      * Add Athena to CircleCI config. Don't wait for Java 11 tests to finish before driver tests.
      
      * ALL TESTS ARE PASSING! <3
      
      * Copy fixes for https://github.com/dacort/metabase-athena-driver/issues/115;
      
       add test
      
      * We don't need to prep source files or fetch dependencies before running backend tests.
      
      * Fix Eastwood error.
      
      * Tweak CircleCI config.
      
      * Fix TIMESTAMP WITH TIME ZONE
      
      * Include the Athena/Redshift repos in the build-drivers deps.edn
      
      * Build and release scripts need to have the :mvn/repos as well
      
      * Revert change that enabled test for Presto
      
      * Un-enable failing test for Snowflake as well.
      
      * moves all is clauses into the test
      
      - previously only the first few tests were being run
      
      * Sort ns in `metabase.driver.athena-test`
      
      * Prevent athena's log4j2.properties file from becoming log config
      
      athena includes log4j2.properties top-level with the properties:
      
      ```
      status = debug
      rootLogger.level=debug
      ```
      
      And this kills our beautifully crafted logging. Set
      "log4j2.configurationFile" in bootstrap to our own log4j2.xml.
      
      Log4j2 looks in a few places for its logging config, the first of which
      is the properties file. So when the jar is loaded, log4j2 considers this
      a logging config change and we lose our logging.
      
      Co-authored-by: default avatarDamon P. Cortesi <d.lifehacker@gmail.com>
      Co-authored-by: default avatarBryan Maass <bryan.maass@gmail.com>
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      a32bb77b
    • Mahatthana (Kelvin) Nomsawadi's avatar
      Match static combo chart colors and legends with app viz colors (#26211) · c6e41b75
      Mahatthana (Kelvin) Nomsawadi authored
      * Match static combo chart colors with app viz colors
      
      * Match colors when individual series color is set
      
      * Remove tests that test colors
      
      Since colors is now determined in FE
      
      * Fix static viz Series type
      
      * Match static progress bar colors with app viz colors
      
      * Simplify Clojure code, makes it more idiomatic
      
      * Fix certain combo charts don't respect whitelabel colors
      
      * Make Clojure code more idiomatic
      
      * Fix Series type
      
      * Add colors back to static internal page
      
      * Simplify type predicate
      
      * fix colors matching for multiple series with mulitple metrics or dimensions
      
      * Handle legends not formatted in static viz in some cases
      
      * Fix failed BE tests after BE API changed
      
      * Fix failed BE tests after BE API changed
      
      * Add multiple series dashcard test to `getSeriesWithColors` test
      
      * Add `getSeriesWithLegends` tests
      
      * Fix URL `/_internal/static-viz` not loading due to API change
      
      * Correctly render legend when having dashcard title set
      
      * Simplify combo-chart API
      
      don't really need `settings-seqs` yet
      
      * Make static combo chart component type easier to understand
      
      * Address review: refactor `render-multiple-lab-chart`
      
      * Make variable names easier to understand
      
      * Simplify color API
      
      * Address review on `body.clj`
      
      * Address review, make parameter name more consistent
      
      * Fix multiple scalars not rendering
      
      * Remove unused imports
      c6e41b75
  12. Nov 28, 2022
Loading