-
- Downloads
Some improvements to the REST API for query field validation (#46024)
* Allow filtering on collection * Add `effective_ancestors` to collection data Note: I removed the `qv=` comparator. I think it'.s better to be more explicit about what exactly we're asserting. In particular, I hadn't updated the `:count` when we were filtering on collection type, so the count was still the total for *every* collection even though the results were being restricted by the collection. However the `qv=-data` function was still reporting that everything was OK, because it was accounting for other data from the App DB by just asserting that the count we'd specified was lower than the actual count. I'd argue it's better for tests to fail locally because I have garbage in my app DB (which I can clean up) than succeed when they really shouldn't. * Consolidate effective ancestors For the Search API, we're currently returning slightly different ancestors: - it never has the Root Collection, and - the ancestors don't have a `personal_owner_id` We could change the API (and maybe will soon - it seems pretty unexpected to have `effective_ancestors` sometimes act one way and sometimes act another) but for now we can just reshape things to look the same as they did before, while using the same code under the hood.
Showing
- .clj-kondo/macros/metabase_enterprise/query_reference_validation/api_test.clj 3 additions, 1 deletion...tabase_enterprise/query_reference_validation/api_test.clj
- enterprise/backend/src/metabase_enterprise/query_reference_validation/api.clj 38 additions, 24 deletions...rc/metabase_enterprise/query_reference_validation/api.clj
- enterprise/backend/test/metabase_enterprise/query_reference_validation/api_test.clj 122 additions, 163 deletions...tabase_enterprise/query_reference_validation/api_test.clj
- src/metabase/models/collection.clj 27 additions, 12 deletionssrc/metabase/models/collection.clj
- src/metabase/search/impl.clj 15 additions, 41 deletionssrc/metabase/search/impl.clj
- test/metabase/api/collection_test.clj 7 additions, 6 deletionstest/metabase/api/collection_test.clj
- test/metabase/models/collection_test.clj 7 additions, 16 deletionstest/metabase/models/collection_test.clj
Loading
Please register or sign in to comment