Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Jan 17, 2023
  2. Jan 13, 2023
  3. Jan 11, 2023
  4. Jan 06, 2023
  5. Jan 05, 2023
    • Cal Herries's avatar
      datetime-diff function for MongoDB (#27042) · ba581fa6
      Cal Herries authored
      
      * Fix mongo version checking for now
      
      * Add minor versions for comparison
      
      * Handle nil case
      
      * newline
      
      * Replace _
      
      * Use dbms-version semantic-version instead
      
      * Compare only the major and minor version
      
      * Fix mongo database-supports?
      
      * Fix duplicate require
      
      * Fix typo
      
      * Remove expressions from version check
      
      * Fix various mongo expressions
      
      `trim`, `rtrim`, `ltrim` needed to be wrapped in `{"input" expr}` object
      `replace` needed to be wrapped in `{"input" expr "find" ...
      "replacement" ...}' object
      `substring` needed to fill in the 3rd argument, optional in mbql but
      required in mongo. Also to use a 1 based index
      
      * Generalize semantic-version-gte
      
      * Used synced dbms_version for testing feature support
      
      * Expressions are only supported by mongo 4.2+
      
      * Disable some tests
      
      * Fix mongo division
      
      Handle nulls with an upfront condition check.
      Handle multiple divisors.
      
      * Remove unused namespace
      
      * Throw exeception if using replace on mongo < 4.4
      
      * Skip test because of #27249
      
      * Move minimum Mongo CI version to 4.2
      
      * Fix sorting by expressions
      
      $sort needs to come before $project otherwise we can only see the
      projected fields, however expressions are only added in $project.
      
      So now if a sort includes an expression, we will use $addFields to be
      able to sort by that expression.
      
      * Disable tests for expressions inside aggregations
      
      To be addressed by #27275
      
      * Handle aggregation nested in an expression
      
      * Remove :truncation-start workaround
      
      * Enable tests for expressions inside aggregations
      
      * Fix datetime-math-tests
      
      * Make sure dbms_version is included when fetching database for store
      
      * Update doc for replace to indicate it should replace all occurrences
      
      * Add mongo datetime-diff
      
      * Fix database-supports?
      
      * Fix order-by-test
      
      * Handle embedded special aggregations (#27315)
      
      * Handle embedded special aggregations
      * Preserve aggregation options for nested aggregations
      * Use top-level aggregation name as group name
      
      * Disable nil punning on semantic version check (#27317)
      
      * Remove nil punning from database-supports?
      
      * Formatting
      
      * Refactor based on Tamas' suggestions
      
      * Change datetime-diff from case statement to multimethod
      
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      Co-authored-by: default avatarTamás Benkő <tamas@metabase.com>
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Unverified
      ba581fa6
    • Ngoc Khuat's avatar
      `metabase.util.schema` to Malli (#27471) · 6d7f778e
      Ngoc Khuat authored
      Unverified
      6d7f778e
  6. Jan 03, 2023
    • Case Nelson's avatar
      Mongo remove v3 support (#27176) · 9c6997bb
      Case Nelson authored
      
      * Fix mongo version checking for now
      
      * Add minor versions for comparison
      
      * Handle nil case
      
      * newline
      
      * Replace _
      
      * Use dbms-version semantic-version instead
      
      * Compare only the major and minor version
      
      * Fix mongo database-supports?
      
      * Fix duplicate require
      
      * Fix typo
      
      * Remove expressions from version check
      
      * Fix various mongo expressions
      
      `trim`, `rtrim`, `ltrim` needed to be wrapped in `{"input" expr}` object
      `replace` needed to be wrapped in `{"input" expr "find" ...
      "replacement" ...}' object
      `substring` needed to fill in the 3rd argument, optional in mbql but
      required in mongo. Also to use a 1 based index
      
      * Generalize semantic-version-gte
      
      * Used synced dbms_version for testing feature support
      
      * Expressions are only supported by mongo 4.2+
      
      * Disable some tests
      
      * Fix mongo division
      
      Handle nulls with an upfront condition check.
      Handle multiple divisors.
      
      * Remove unused namespace
      
      * Throw exeception if using replace on mongo < 4.4
      
      * Skip test because of #27249
      
      * Move minimum Mongo CI version to 4.2
      
      * Fix sorting by expressions
      
      $sort needs to come before $project otherwise we can only see the
      projected fields, however expressions are only added in $project.
      
      So now if a sort includes an expression, we will use $addFields to be
      able to sort by that expression.
      
      * Disable tests for expressions inside aggregations
      
      To be addressed by #27275
      
      * Handle aggregation nested in an expression
      
      * Remove :truncation-start workaround
      
      * Enable tests for expressions inside aggregations
      
      * Fix datetime-math-tests
      
      * Make sure dbms_version is included when fetching database for store
      
      * Update doc for replace to indicate it should replace all occurrences
      
      * Fix order-by-test
      
      * Handle embedded special aggregations (#27315)
      
      * Handle embedded special aggregations
      * Preserve aggregation options for nested aggregations
      * Use top-level aggregation name as group name
      
      * Disable nil punning on semantic version check (#27317)
      
      * Optimize produced query for division when dividing by literals
      
      * Rename var
      
      * Use reduce to build division
      
      * Fix reduction
      
      * Clean up formatting and document some details
      
      Co-authored-by: default avatarCallum Herries <hi@callumherries.com>
      Co-authored-by: default avatarTamás Benkő <tamas@metabase.com>
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Unverified
      9c6997bb
    • Cal Herries's avatar
      datetime-diff function for athena (#27205) · ae59ec81
      Cal Herries authored
      * Add datetime-diff implementation for athena
      
      * Don't run some tests for drivers not supporting timestamptz
      
      * Fix for date types
      
      * Use date-trunc helper
      
      * Add comment about Athena's timestamp with time zone type
      
      * Add datetime-diff-time-zones-athena-test
      
      * Fix typo
      
      * Fix typo
      
      * Rewrite comment
      
      * Tidying
      
      * Add athena-datetime-diff-mixed-types-test
      
      * Fix typo
      
      * Adjust comments + formatting
      
      * Adjust comments
      
      * Format SQL query
      
      * Align requires
      Unverified
      ae59ec81
    • Cal Herries's avatar
      datetime-diff function for SQLite (#27076) · ff2934bf
      Cal Herries authored
      * Add sqlite datetime-diff
      
      * Refactor sqlite
      
      * Exclude sqlite from datetime-diff-type-test
      
      * Fix sqlite temporal fields losing type info on sql.qp->honeysql
      
      * Leave the default impl for sql.qp/date
      Unverified
      ff2934bf
    • Cal Herries's avatar
      datetime-diff function for Oracle (#27196) · 3779a169
      Cal Herries authored
      * Add oracle datetime-diff
      
      * Remove duplicate method impls
      
      * Remove unused require
      Unverified
      3779a169
  7. Dec 31, 2022
  8. Dec 29, 2022
  9. Dec 28, 2022
  10. Dec 21, 2022
  11. Dec 20, 2022
  12. Dec 16, 2022
    • Cal Herries's avatar
      Refactor datetime-diff implementations: sqlserver, mysql, bigquery, redshift,... · 615c5a4e
      Cal Herries authored
      Refactor datetime-diff implementations: sqlserver, mysql, bigquery, redshift, snowflake, vertica, postgres (#27262)
      
      * Refactor bigquery datetime-diff to use multimethod
      
      * Refactor snowflake datetime-diff to use multimethod
      
      * Refactor SQL server datetime-diff to use multimethod
      
      * Refactor mysql datetime-diff to use multimethod
      
      * Refactor redshift datetime-diff to use multimethod
      
      * Simplify vertica datetime-diff
      
      * Tidy postgres datetime-diff
      
      * ; -> ;; in snowflake comment
      
      * Add to bigquery comment
      Unverified
      615c5a4e
  13. Dec 15, 2022
  14. Dec 14, 2022
  15. Dec 12, 2022
    • Cal Herries's avatar
      Support "quarter" unit for datetimeDiff (#27015) · 438e0684
      Cal Herries authored
      * Add quarter for postgres
      
      * Add quarter to schema
      
      * Add quarter tests
      
      * Add quarter for mysql
      
      * Add quarter for bigquery
      
      * Add quarter for snowflake
      
      * Add quarter for redshift
      
      * Add quarter for vertica
      
      * Add quarter for sqlserver
      
      * Add quarter to docs
      
      * Fix snowflake implementation
      
      * Make time zone dataset smaller
      
      * Revert "Make time zone dataset smaller"
      
      This reverts commit 4c97048d6c01e0f83b259a00c39d34169036fe77.
      
      * Revert "Revert "Make time zone dataset smaller""
      
      This reverts commit d1b8fc49c8bf86fecd9897a7c4f496dbdb1b9b06.
      
      * Fix test for drivers not supporting set-timezone
      Unverified
      438e0684
    • metamben's avatar
      Use the original string if humanization results in a blank string (#27161) · 8c7d0bcd
      metamben authored
      This is to enable _ as field name.
      Unverified
      8c7d0bcd
  16. Dec 08, 2022
    • Case Nelson's avatar
      Disable Athena driver IAM role-based auth in Cloud (#27048) · 1b0e4cf5
      Case Nelson authored
      Fixes #27014
      
      Our cloud hosting requires using hard coded IAM auth for Athena. So make
      sure that if the access_key is left blank, we only fall back to the
      credential chain if we are not in a hosted environment.
      Unverified
      1b0e4cf5
    • 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
      Unverified
      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
      Unverified
      d3a98472
    • metamben's avatar
      Fingerprint bigquery by previewing tables (#26962) · 1c588b60
      metamben authored
      * Fingerprint bigquery by previewing tables
      * Address review comments
      Unverified
      1c588b60
    • 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`
      Unverified
      c39f17fe
    • 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
      Unverified
      dc746c4e
    • Cal Herries's avatar
      datetime-diff function for redshift (#26758) · 407d83cb
      Cal Herries authored
      
      * Add redshift implementation
      
      * Add failing tests
      
      * Fix bigquery
      
      * Formatting
      
      * fix? set-param for redshift
      
      * Replace literals for datetime-diff-time-zones-test
      
      * Actually use fields
      
      * Fix typo
      
      * Rename dataset
      
      * Add type/DateTimeWithTZ column, since redshift doesn't like type/DateTimeWithZoneOffset
      
      * Cast to timestamp for week diff
      
      * Revert "fix? set-param for redshift"
      
      This reverts commit 235f3aca2a4b3bf41469d7bb73266d3f5e54f5d2.
      
      * Fix leap years
      
      * Remove redundant date-trunc
      
      * Formatting
      
      * Fix mismatched types
      
      * Fix extract
      
      * Add comment for why redshift needs an implementation
      
      Co-authored-by: default avatarNgoc Khuat <qn.khuat@gmail.com>
      Unverified
      407d83cb
    • Cal Herries's avatar
      datetime-diff function for vertica (#26816) · 6d132831
      Cal Herries authored
      * vertica datetime-diff implementation
      
      * Don't need type info
      
      * Refactor implementation
      
      * Fix seconds
      
      * Cast to timestamp before comparison
      
      * Fix set-parameter for vertica
      
      * formatting
      
      * Sort ns
      
      * Remove set-parameter changes
      
      * Replace literals for datetime-diff-time-zones-test
      
      * Fix requires
      
      * Actually use fields
      
      * Fix typo
      
      * Rename dataset
      
      * Add type/DateTimeWithTZ column, since redshift doesn't like type/DateTimeWithZoneOffset
      
      * Add failing tests
      
      * Fix bigquery
      
      * Formatting
      
      * Fix mismatched types
      Unverified
      6d132831
  17. Dec 07, 2022
Loading