Dowload Row Limit Env Var (#46401)
* Dowload Row Limit Env Var Adds `MB_DOWNLOAD_ROW_LIMIT` to enable changing the row limit on downloads and alert/subscription attachments (not the rendered tables, but the .csv, etc.). Based on: #44982 (Thanks, @r-kot) Partially implements: #28144 The difference in this PR compared to #44982 is that the download limit applies to all downloads, the only exception being when the limit is above `qp.i/absolute-max-results` (1048575, based on Excel's limitation); in such a case, the user supplied limit is only used if the download is csv or json, and `qp.i/absolute-max-results` is used for xlsx. This PR also fixes alert/subscription attachment limits; prior to this, they were set to the in-app limit of 2000 rows, but now they will follow the user supplied download-row-limit. This PR also adds a test to the downloads-and-exports test namespace, confirming that they follow the supplied limit, or the max limit if none is supplied. * add test confirming the default limit works * fix test to use the download-row-limit * address review feedback * Update src/metabase/public_settings.clj Co-authored-by:Cal Herries <39073188+calherries@users.noreply.github.com> * add test covering case where download-row-limit is unset --------- Co-authored-by:
Cal Herries <39073188+calherries@users.noreply.github.com>
Showing
- src/metabase/public_settings.clj 7 additions, 0 deletionssrc/metabase/public_settings.clj
- src/metabase/pulse/util.clj 20 additions, 17 deletionssrc/metabase/pulse/util.clj
- src/metabase/query_processor/middleware/limit.clj 15 additions, 3 deletionssrc/metabase/query_processor/middleware/limit.clj
- test/metabase/api/downloads_exports_test.clj 37 additions, 0 deletionstest/metabase/api/downloads_exports_test.clj
- test/metabase/pulse_test.clj 2 additions, 3 deletionstest/metabase/pulse_test.clj
- test/metabase/query_processor/middleware/limit_test.clj 56 additions, 0 deletionstest/metabase/query_processor/middleware/limit_test.clj
Please register or sign in to comment