This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Jan 31, 2022
-
-
dpsutton authored
* Improve lifecycle of metadata Previously we have assumed that if valid metadata is passed into the card create and udpate, that that is valid metadata for the query. There are a few scenarios where this can fail, but they all boil down to editing the query after running it. Examples: - when creating a query, come up with a query, visualize, realize you wanted to not select all columns, edit to not select those, possibly select a few extra, and then save. The saved metadata might only have the columns from when you ran the query and not after you saved it. - edit an existing query and save without rerunning. Again, adding and removing some columns. How it affects: - if you remove columns, the preserved metadata can cause us to attempt to select columns that are no longer in that question, leading to errors for nested queries - if you add columns, the query builder won't show the new columns until that information is populated in the metadata by running the query. Lifecycle now: - should be encapsulated in `api.card/result-metadata-async`. But we only allow metadata to remain if is is valid metadata and the query has not been edited. If the query has been edited (and new queries always satisfy this since the previous query will be nil) we rerun the query to get the metadata. No more drift. However, when dealing with datasets we will attempt to blend the existing metadata into the newly computed metadata so that metadata edits can persevere. Other changes: - removed an extra indirection in the card api that made it harder to reason about when to recompute metadata - moved the `combine-metadata` function into a util namespace and gave some more generic parameter names - deleted two tests that are no longer relevant after removing the checksum on metadata. One had to do with how we hash floats vs ints which is no longer relevant since we aren't hashing at all (RIP checksum) and one checked that we accepted "valid" checksum-ed metadata. - new test that updating a card will update its metadata by rerunning the query - when validating the checksum, do not call s/validate since this WILL THROW. Instead check `(nil? (s/check ...))`. * Normalize query before comparing for changes When comparing db vs api-sent query, need to normalize otherwise they will always be different and our optimization will never kick in * Fix ns * Cleanup after ourselves * Move `combine-metadata` util functions to a better namespace * Allow for no query in api/card/:id patch Cypress tests would do a ```javascript describe("simple mode", () => { beforeEach(() => { cy.request("PUT", "/api/card/1", { name: "Orders Model", dataset: true, }); }); ``` The metadata testing stuff would always use the query from the PUT to check whether to dump or retain the metadata. In these instances, it would dump the metadata and then i guess ask the qp for the metadata for a nil query. Similar scenario if anyone uses the API to update descriptions, etc. The method is PUT not PATCH, but in the saving function we have ```clojure (u/select-keys-when card-updates :present #{:collection_id :collection_position :description :cache_ttl :dataset} :non-nil #{:dataset_query :display :name :visualization_settings :archived :enable_embedding :embedding_params :result_metadata}) ``` So we kinda have a PATCH anyways. * Normalize metadata before blending * Ensure api blends metadata correctly When blending the metadata, need to update the field_ref to keyword the original. Otherwise we are attempting to match up the field with ref ["field" "subtotal"] against [:field "subtotal"] and they don't match. * Normalize metadata from api correctly if you just call normalize/normalize it doesn't know not to change `:field_ref` -> `:field-ref` so it gets out of whack. Need to pass it the function appropriate for that level. Also add a test that you can update _just_ the metadata. This actually already worked for a subtle reason, and that is possibly buggy. The reasoning is that the result_metadata is clobbered conditionally now instead of unconditionally. If the async metadata stuff returns nil it won't clobber and then whatever was sent over the wire goes in. * Ensure previous metadata is there When updating the query of a dataset, handle the case where just the query is sent, and not the whole card. If the client didn't send the previous metadata, we did not look it up in the database * Card api always uses metadata from `result-metadata-async` Originally this did (assoc card-data :result_metadata (a/<! result-metadata-chan)) But I changed that so it only optionally did so when that channel had information. The problem with this is that if there was :result_metadata on the original request but the channel returned nil for some reason, whatever was in the request was going in the db. This includes invalid metadata, non-json strings, what ever. Obviously bad. But we need to handle PATCHs where clients don't send metadata or they _ONLY_ send metadata and no query, etc. So this always uses the results of `result-metadata-async` so it can go through that logic and we always clobber. And remember that if we only update the result_metadata when it is non-nil (`update-card-async!`). The end result is that switching from a PATCH model where you expect the full object to a PUT where things can be optional has lots of footguns. Some examples: - only updating the query - updating the query along with edits to the metadata on a card (throw the metadata away) - updating the query along with edits on a dataset (save the metadata but blend it into the fresh computation of the query's metadata) - updating the query but not sending along the metadata. Need to grab from the db and blend in. - Sending invalid metadata, changing the description. We want to toss away the metadata but save the description.
-
Alexander Lesnenko authored
* support stacked area static viz series * fix x-ticks overflow * fix types * add specs, fix area static charts
-
Ariya Hidayat authored
-
Alexander Lesnenko authored
* run eslint on typescript files * fix errors * bump timeout
- Jan 28, 2022
-
-
Maz Ameli authored
* change model icon from waffle to building block * update models education illustration
-
Alexander Polyankin authored
-
Alexander Polyankin authored
-
Alexander Polyankin authored
-
frannietrempe authored
* docs - running development branch instructions * reorganized content into existing pages * Jeff edits Co-authored-by:
Jeff Bruemmer <jeff@metabase.com> * remove gh command, minor edits * reorganizing step numbers Co-authored-by:
Jeff Bruemmer <jeff@metabase.com>
-
john-metabase authored
Thanks for the review/approvals.
-
frannietrempe authored
-
Noah Moss authored
-
Nemanja Glumac authored
-
Howon Lee authored
Adds an endpoint to the cards which are basically materially like dashboard/:id/copy, only it's for card/:id/copy - POST to it, get a copy of that entity.
-
Alexander Polyankin authored
-
Alexander Polyankin authored
-
Alexander Kiselev authored
Move filters over into a separate bar below the header and move the filter button over to the right side of the header
-
- Jan 27, 2022
-
-
Maz Ameli authored
* redo tweaks from 19853 that got clobbered in the rebase * smaller text size for collections list items * make unpinned items list more compact
-
Bryan Maass authored
* Add has-user-setup setting - iff no user is setup aka has-user-setup == false, then redirect to /setup - when set from the env variable the setup-token is completely immutable, so can remove clear-token! * make /api/setup only setup accounts when not has-user-setup - react router changes to respect 'has-user-setup' setting - include docstring for print-setup-url * allow tests to setup multiple users via POST /api/setup * remove unused function hasSetupToken * Adds a test to enforce a single creation only - we now throw an ex-info with status-code 403 when has-user-setup and /api/setup route is hit (with error message mentioning the route) - more code review responses - fixup test to not delete users, (or set locale to spanish...) * addressing code review concerns - *disallow... -> *allow... for the dynamic var name - has-user-settings test: do not assume the test db has users in it - update test
-
Gustavo Saiani authored
-
Alexander Polyankin authored
-
Alexander Polyankin authored
-
Anton Kulyk authored
-
Anton Kulyk authored
* Make `getRevisionEvents` accept params object * Use "You" for current user's revision events * Fix "moved to" revision display * Add extra bottom padding to events timeline * Extract conditions into variables
-
Noah Moss authored
-
Dalton authored
* fix cut-off text in Safari * Actually fix cut-off text in Safari
-
Ariya Hidayat authored
-
Alexander Lesnenko authored
* always show permission help * fix permission page layout
-
Anton Kulyk authored
* Remove saving changes from `setColumnType` helper * Use single POST request to create a model in cypress * Add E2E test * Display metadata editing revision events * Change message
-
Anton Kulyk authored
* Unksip x-ray test * Handle nullish dashboard parameters
-
Anton Kulyk authored
* Add `dataset` to Card type * Fix "source-table" type * Don't use original model query in ad-hoc mode * Handle model using `/dataset` endpoint in Cypress * Rerun query when entering model editor * Make it possible to only close the details sidebar * Close details sidebar when entering model ad-hoc mode * Move `isAdHocModelQuestion` to data-modeling utils * Handle TableInteracting column width reset event * Fix old isAdHoc util usage
-
- Jan 26, 2022
-
-
Gustavo Saiani authored
-
adam-james authored
* Add question link to the 'stopped working' email template. * Adjusted copy from alert email to correctly indicate how to unsubscribe
-
Jeff Evans authored
* Trim whitespace around commas in schema filtering code Change impl of `schema-pattern->re-pattern` so that strings are trimmed before being joined on `|` Add test to confirm
-
Noah Moss authored
Co-authored-by:
Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
-
Alexander Lesnenko authored
* fix license and billing page * fix imports cycle * specs * use no-upsell flag * fix condition
-
Ariya Hidayat authored
-
Ariya Hidayat authored
-
Jeff Evans authored
* Support overriding ROWCOUNT for SQL Server Add new "ROWCOUNT Override" connection property for `:sqlserver`, which will provide a DB-level mechanism to override the `ROWCOUNT` session level setting as needed for specific DBs Change `max-results-bare-rows` from a hardcoded constant to a setting definition instead, which permits a DB level override, and move the former constant default to a new def instead (`default-max-results-bare-rows`) For `:sqlserver`, set the DB-level setting override (if the connection property is set), via the `driver/normalize-db-details` impl Add test to confirm the original scenario from #9940 works using this new override (set to `0`) Move common computation function of overall row limit to the `metabase.query-processor.middleware.limit` namespace, and invoke it from execute now, called `determine-query-max-rows` Add new clause to the `determine-query-max-rows` function that preferentially takes the value from `row-limit-override` (if defined)
-