Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Jan 31, 2024
    • John Swanson's avatar
      Query row limit doesn't limit in-product downloads (#37716) · aa76efb2
      John Swanson authored
      I misunderstood the desired behavior when I implemented this before. We
      only want the limit to apply when the `add-default-userland-constraints`
      middleware is applied to the query, not when we're downloading the data
      directly.
      
      This is a bit of a rat's nest. If there's a better way to approach the
      problem, I'd be happy to hear it. I added documentation for the odd approach
      as much as possible.
      
      The main difficulty is that the userland middleware does not have access
      to db-local settings. So if we want db-local settings to apply only to
      userland, we have to hack our way around it.
      
      The solution here is to divide the userland middleware into two parts:
      
      - the actually-userland bit, which just marks the query as needing
      default limits, and
      
      - a middleware inserted deeper in the middleware stack (just before we
      actually apply limits) that actually calculates those limits and
      attaches them to the query.
      Unverified
      aa76efb2
  2. Jan 30, 2024
    • metamben's avatar
      Cast to timestamp before truncating (#38214) · 636258a7
      metamben authored
      * Cast to timestamp before truncating
      
      The shift according to the timezone after the truncation can produce values not at the beginning of the truncation
      period.
      
      * Separate handling of time and date inputs
      
      * Add test reproducing issue #37065
      Unverified
      636258a7
  3. Jan 26, 2024
  4. Jan 25, 2024
  5. Jan 22, 2024
  6. Jan 19, 2024
  7. Jan 18, 2024
  8. Jan 17, 2024
  9. Jan 16, 2024
  10. Jan 15, 2024
  11. Jan 12, 2024
  12. Jan 11, 2024
  13. Jan 08, 2024
  14. Jan 04, 2024
  15. Jan 03, 2024
  16. Dec 28, 2023
  17. Dec 24, 2023
  18. Dec 22, 2023
  19. Dec 21, 2023
  20. Dec 20, 2023
  21. Dec 15, 2023
  22. Dec 14, 2023
    • John Swanson's avatar
      Rename `max-*-query-row-limit` to `*-query-row-limit` (#36753) · e8f3a453
      John Swanson authored
      @jeff-bruemmer pointed out that these names are redundant in #36723.
      
      Theoretically one could argue that the settings aren't actually setting the "query row limit" - when you make a new
      question, you can enter whatever limit you like. Instead, they're setting the *maximum* possible "query row limit."
      
      That said, applying two limits is the same as applying the minimum of two limits, so calling it a "query row limit"
      makes sense too, and might be more clear.
      Unverified
      e8f3a453
    • Ngoc Khuat's avatar
      Sync index info: mongo (#36624) · 4908696a
      Ngoc Khuat authored
      Unverified
      4908696a
    • Ryan Kienstra's avatar
      Move `sample-dataset` into `test-data` for backend tests (#35973) · 26bbec63
      Ryan Kienstra authored
      * Move sample-dataset.edn into test-data.edn
      
      Replace (mt/dataset sample-dataset with (mt/dataset test-data
      
      Replace more references to sample-dataset with test-data
      
      Fix the format of the combined data
      
      Might revert: remove test that doesn't apply, now that there's 1 DB
      
      Make api.database-test pass, though expected could be wrong
      
      * Update unit tests for combined dataset
      
      * Bump Bigquery version from v3_ to v4_
      
      * Bump v3_test-data to v4_test-data
      
      * Remove wrapping with mt/dataset
      
      Alphabetize fk-mappings
      
      * Remove needless whitespace edits
      
      * Fix failed e2e_test by removing reference to sample-dataset
      
      * Fix tests for Mongo, Oracle, Snowflake, and Presto
      
      * Fix unit tests again for Mongo, Presto, and Snowflake
      
      * Will revert: run driver tests on my fork
      
      * Will revert: run driver tests on my draft fork
      
      * Revert "Will revert: run driver tests on my draft fork"
      
      This reverts commit 078c8af1.
      
      * Revert "Will revert: run driver tests on my fork"
      
      This reverts commit e3e2922f.
      
      * Make the postgres driver test pass again by reverting a change
      
      * Apply Case Nelson's patch to fix Athena test
      
      https://github.com/metabase/metabase/pull/36064#issuecomment-1824837705
      Props @snoe
      
      * Remove (mt/dataset sample-dataset) from new tests
      
      * Maybe fix Athena driver tests
      
      Revert needless deletions of (mt/dataset test-data
      Maybe those deletions caused the
      failing Athena driver tests.
      But those deletions are out of scope
      for this PR either way.
      
      * Remove sample-dataset reference from a test in the master merge
      
      * In card_test.clj, replace sample-dataset with test-data
      
      * Merge in master, resolve conflict in pivot-from-model-test
      
      * Merge in master, resolve conflict in pivot-from-model-test
      
      * Must revert: allow databse creation
      
      To see if it will fix:
      https://github.com/metabase/metabase/actions/runs/7120808552/job/19388845720?pr=36064#step:3:441
      
      
      Athena database creation is disabled: not creating database v2_test_data. Tests will likely fail.
      
      * Revert "Must revert: allow databse creation"
      
      This reverts commit d4c8f129.
      
      * Add back in (mt/dataset where I deleted it
      
      But replace sample-dataset with test-data.
      This might be wrong, or maybe it's not needed in
      so many places.
      But it could show if this is the problem.
      
      * Fix the failed sync test
      
      ---------
      
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      Unverified
      26bbec63
  23. Dec 13, 2023
  24. Dec 12, 2023
  25. Dec 08, 2023
  26. Dec 07, 2023
  27. Dec 04, 2023
  28. Dec 01, 2023
    • lbrdnk's avatar
      Use server side generated timestamps for :relative-datetime (#35995) · 16988f50
      lbrdnk authored
      * WIP: Use server side generated timestamps for :relative-datetime
      
      * Use correct timestamp in :relative-datetime and add tests
      
      * Update tests
      
      * Remove combinations of tzs test
      
      I've added those to commit in case we
      need to refer to it in future. Tests like that take ~500 seconds,
      hence good for one off testing.
      
      * Update docstrings and comments
      
      * Use string formatted qp.timezone/now as a base
      
      * Address review remarks
      
      * Remove redundant data from "last queries" query
      
      * Update tests
      
      - Add comment that points on discussion on flake potential of a test.
      - Correct the order of expected and actual in another test.
      - Add formatting to rows and select only necessary for testing in a test.
      Unverified
      16988f50
  29. Nov 30, 2023
  30. Nov 27, 2023
  31. Nov 24, 2023
    • lbrdnk's avatar
      Use sessions in mongo aggregation pipelines (#35680) · e357b238
      lbrdnk authored
      * Use mongo sessions in aggregation pipelines
      
      Using sessions, cancel signal from streaming response can be handled
      correctly - query is killed also on database side.
      
      * Update tests
      
      * Let the middleware handle the exception
      
      While coding the other test, I've found out that if exception is handled
      in the `reducible-results`, code clogs for 3 minutes,
      which is `.maxTime` for aggregation. I don't know the exact reason yet,
      but for time being I'm leaving the exception handling to middleware.
      
      * Add testing string
      
      * Encode aggregation results as `BasicDBObject`
      
      Use this type instead of BSON's Document because code transforming
      DBObject to clojure structures is already in place.
      
      * Update exceptions handling and tests
      
      Exception handling now more resembles code in other drivers. Tests were updated
      to use mbql query instead of raw native to avoid differences between various
      mongodb versions. `$dateTrunc` was not available in version 4.
      
      * Increase cancelation interval in tests
      
      * Address remarks and update test to handle cold start
      
      By cold start I mean running it before dataset is initialized.
      
      * Remove unnecessary hint
      Unverified
      e357b238
Loading