This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Mar 01, 2023
-
-
metabase-bot[bot] authored
-
metabase-bot[bot] authored
-
- Feb 28, 2023
-
-
dpsutton authored
* Delay substituting persisted native query until after analysis We were substituting persisted queries into the query at too early a stage. Card 729 is a persisted model of `select * from categories` ```clojure {:type :query, :query {:source-table "card__729", :expressions {:adjective ["case" [[[">" ["field" 100 nil] 30] "expensive"] [[">" ["field" 100 nil] 20] "not too bad"]] {:default "its ok"}]}, :aggregation [["count"]], :breakout [["expression" "adjective" nil] ["field" 101 nil]]}, :database 3, :parameters []} ``` This would immediately get turned into an equivalent ```clojure {:type :query, :query {:source-table 12 :persisted-info/native "select \"id\", \"ean\", \"title\", \"category\", \"vendor\", \"price\", \"rating\", \"created_at\" from \"metabase_cache_424a9_3\".\"model_729_products_r\"" :expressions {:adjective ["case" [[[">" ["field" 100 nil] 30] "expensive"] [[">" ["field" 100 nil] 20] "not too bad"]] {:default "its ok"}]}, :aggregation [["count"]], :breakout [["expression" "adjective" nil] ["field" 101 nil]]}, :database 3, :parameters []} ``` And the obvious failure here is the use of `[:field 100 nil]` (price) against an inner query of `select ... price ... from cache_table`. This could break many queries and caused a flood of ``` WARN middleware.fix-bad-references :: Bad :field clause [:field 100 #:metabase.query-processor.util.add-alias-info{:source-table :metabase.query-processor.util.add-alias-info/source, :source-alias "price"}] for field "products.price" at [:expressions "adjective" :case :>]: clause should have a :join-alias. Unable to infer an appropriate join. Query may not work as expected. WARN middleware.fix-bad-references :: Bad :field clause [:field 100 #:metabase.query-processor.util.add-alias-info{:source-table :metabase.query-processor.util.add-alias-info/source, :source-alias "price"}] for field "products.price" at [:expressions "adjective" :case :>]: clause should have a :join-alias. Unable to infer an appropriate join. Query may not work as expected. ``` * forgot to commit new test file * Handle persisted before native * Add test for native models - have to populate the metadata. You can do this by running the query, but there are some requirements around the `:info` object to actually save it. So just take the more mechanical route - `wait-for-result` returns a time out value, but it's namespaced autoresolved to a namespace inside of the metabase.test forest and not mt itself. So easy to mess up and watch for the wrong keyword. Want an arity so i can check my own timeout value and throw a helpful error message. I checked around and noone seems to care. So not great, but at least people aren't checking `::mt/timed-out` when it should be `::tu.async/timed-out` or `:metabase.test.util.async/timed-out`. Possibly best scenario is we remove the autoresolved bit and have it return `:async/timed-out` or something stable. * properly compile the native query * bump timeout to set redshift metadata
-
john-metabase authored
Cleans/fixes serdes v2 export :collections handling in cmd and API
-
Anton Kulyk authored
* Handle errors when enabling database actions * Use more common error message fallback * Use `Promise<void>` for other `Sidebar` callbacks
-
Alexander Polyankin authored
-
Nick Fitzpatrick authored
* Adding flex grow to card wrapper * Optimize repro * fix height on cards --------- Co-authored-by:
Nemanja <31325167+nemanjaglumac@users.noreply.github.com> Co-authored-by:
Aleksandr Lesnenko <alxnddr@gmail.com> Co-authored-by:
Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
-
Anton Kulyk authored
* Handle archived and not existing actions * Handle model ID mismatch * Migrate to `fetch-mock` * Don't use URL helpers in tests * Fix action editor assertions in model detail tests
-
john-metabase authored
-
Cal Herries authored
-
Aleksandr Lesnenko authored
* Revert "Fixing Table isValid check (#28411)" This reverts commit 5e18759f. * Revert "GH 28304 and GH 28311 (#28314)" This reverts commit 47bad0d3. * revert column settings changes * object detail view * adjusting e2e tests --------- Co-authored-by:
Nick Fitzpatrick <nick@metabase.com>
-
Denis Berezin authored
-
Nemanja Glumac authored
* Run workflows using `ubuntu-22.04` - batch 2 * Do not run `i18n` workflow on the latest Ubuntu
-
Nemanja Glumac authored
[ci skip]
-
Ngoc Khuat authored
* add tests for sandbox user apis
-
Ngoc Khuat authored
-
Aleksandr Lesnenko authored
-
- Feb 27, 2023
-
-
john-metabase authored
Adds basic logging to v2 export/import, resolves #26859
-
Emmad Usmani authored
-
Braden Shepherdson authored
Dev experience: - CLJS now has source maps - Devtools extension renders CLJS data in Chrome (et al) Devtools - Use a debug build of CLJS in the tests - Fixed line numbers and breakpoints being off-by-one in Devtools CLJC infra: - More robust direct approach to JS<->CLJS conversions, powered by Malli transformers. - Powerful `define-getters-and-setters` macro to generate the accessors.
-
Anton Kulyk authored
* Fix Jest coverage config * Run FE specs when jest configs change --------- Co-authored-by:
Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
-
Mahatthana (Kelvin) Nomsawadi authored
* Fix ErrorBoundary not working in some cases * Allow users to remove database, even if it contains error * Unskip the repro for #25715
-
Nemanja Glumac authored
* Track only frontend source files * Bump `frontend` target to 50% * Bump `backend` target to 85% * Ignore unit tests coverage directly in jest config * Ignore Storybook components from coverage reports
-
Gustavo Saiani authored
* Ensure visible before clicking * Wait for question to load --------- Co-authored-by:
Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
-
Mark Bastian authored
Added post-collection retrieval function `remove-other-users-personal-collections` that will filter out any personal collection that doesn't belong to the current user when the `exclude-other-user-collections=true` path param is used. Also added unit tests for both the `api/collection/` and `api/collection/tree` endpoint.
-
Cal Herries authored
* Add comment for database-enable-actions * Enforce actions not supported implies actions are disabled * Remove test and update check * Fix typos * Revert "Remove test and update check" This reverts commit 8b1f14f44bd97514cd8ce0c9b0a5df048d713b16. * Fix test
-
Braden Shepherdson authored
Large dashboards, and especially tables, cause a lot of recomputation of number and date formats. There's enough overhead in converting to CLJS data that it causes noticable lag on large dashboards, especially in the editor view. There are paths to avoiding the recomputation, which is pretty wasteful in either language. To be investigated after the 46 cut.
-
Alexander Polyankin authored
-
Nemanja Glumac authored
-
Nemanja Glumac authored
-
- Feb 26, 2023
-
-
Nemanja Glumac authored
-
Nemanja Glumac authored
-
- Feb 25, 2023
-
-
Nemanja Glumac authored
[ci skip]
-
- Feb 24, 2023
-
-
Aleksandr Lesnenko authored
-
Aleksandr Lesnenko authored
-
Nick Fitzpatrick authored
* open chart settings when clicking active display type * adjusting tendline e2e test
-
dpsutton authored
* Remove json fields from action parameters ```sql json-test=# select * from json_table; json_val | description ------------------+--------------- {"a": 1, "b": 2} | a description (1 row) ``` This ends up in our db as: ```clojure ({:database_type "json", :name "json_val", :effective_type :type/Structured, :nfc_path nil, :id 73, :display_name "Json Val", :database_required true} {:database_type "bigint", :name "json_val → a", :effective_type :type/Integer, :nfc_path ("json_val" "a"), :id 72, :display_name "Json Val → A", :database_required false} {:database_type "bigint", :name "json_val → b", :effective_type :type/Integer, :nfc_path ("json_val" "b"), :id 74, :display_name "Json Val → B", :database_required false} {:database_type "text", :name "description", :effective_type :type/Text, :nfc_path nil, :id 13670, :display_name "Description", :database_required false}) ``` AKA, exploded. But we cannot enter values for these fields for implicit actions. Before this change, the action thought its parameters were: ```clojure :parameters ({:id "json_val", :target [:variable [:template-tag "json_val"]], :type :type/Structured, :required true} {:id "json_val_%E2%86%92_a", :target [:variable [:template-tag "json_val_%E2%86%92_a"]], :type :type/Integer, :required false} {:id "json_val_%E2%86%92_b", :target [:variable [:template-tag "json_val_%E2%86%92_b"]], :type :type/Integer, :required false} {:id "description", :target [:variable [:template-tag "description"]], :type :type/Text, :required false}) ``` And we just don't know how to handle the exploded json values in the insert statement to create a nested json structure. So lets omit them. After this change: ```clojure action=> (:parameters (select-action :id 14)) ({:id "json_val", :target [:variable [:template-tag "json_val"]], :type :type/Structured, :required true} {:id "description", :target [:variable [:template-tag "description"]], :type :type/Text, :required false}) ``` * Translate `:type/Structured` to JSON for pg Fields have effective_type, and base_type `:type/Structured`. But several other types get marked as this as well: ```clojure actions=> (descendants :type/Structured) -> #{:type/SerializedJSON :type/XML :type/JSON} ``` So for the purposes of this, we _assume_ that structured is synonymous with json. Certainly will error if its xml. This makes the implicit action cast the text input for a json field to json. If the underlying field in pg is jsonb the driver cleans that up for us with no error. * Remove json fields, exploded json fields, unrecognized type fields In order to do this, had to change how we load json fields in test datasets for postgres. It just stuffed them in as text. Mysql would correctly make them json fields but postgres just bailed and left them as text strings. This changes `load-data/load-data!` to look for json columns, and if so, cast them to json when loading. * Remove json and xml checks from dashboard execution tests these are not doing what you think they are doing. they inspire confidence that json works but the underlying fields are actually always text. So it's unfounded confidence; misleading confidence. If you fix this, you quickly run into issues with expressivity in parameters and differences in dbs. A few: - no parameter on a dashboard can express that its type is json - mysql doesn't have an xml type - postgres does have an xml type, and you get back a native PGXML type - since you can't have an implicit type in the parameter, each sql has to cast in its query. And then you start getting differences in return types, queries, and it stops making sense for this all to be in the same query. And at the end of the day, of course you can write a query that casts a string to some native type. That's not really action related. * Let's not do this yet i think this is the correct call but want more tests on it when we flip the switch * Test pg enums in implicit actions * alignment and unused binding * Exclude in maria maria doesn't see the json_bit field as a json column. It's just a text column. So it is not excluded and all of the exploded fields like "json_bit → 1234" are not extracted. So this test is not applicable because it's just a generic implicit action on three fields. * accept suggestions from tamas
-
Emmad Usmani authored
-
Nick Fitzpatrick authored
-
metamben authored
-