Serdes v2: Handle other embedded MBQL fragments (#24537)
This PR handles the other JSON-encoded MBQL snippets I was able to find. These snippets contain `Table` and `Field` IDs, and so are not portable. These fields are expanded during serialization and the IDs replaced with portable references, then converted back in deserialization. Note that the referenced field must already be loaded before it has a valid ID. `serdes-dependencies` defines this order, therefore each entity depends on those tables and fields referenced in its MBQL fragments. The complete set of fields I found to convert: - `Metric.definition` - `Segment.definition` - `DashboardCard.parameter_mappings` - `Card.parameter_mappings`
Showing
- enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj 83 additions, 14 deletions...est/metabase_enterprise/serialization/v2/extract_test.clj
- enterprise/backend/test/metabase_enterprise/serialization/v2/load_test.clj 263 additions, 2 deletions...d/test/metabase_enterprise/serialization/v2/load_test.clj
- src/metabase/models/card.clj 17 additions, 14 deletionssrc/metabase/models/card.clj
- src/metabase/models/dashboard_card.clj 11 additions, 7 deletionssrc/metabase/models/dashboard_card.clj
- src/metabase/models/metric.clj 9 additions, 5 deletionssrc/metabase/models/metric.clj
- src/metabase/models/segment.clj 9 additions, 5 deletionssrc/metabase/models/segment.clj
- src/metabase/models/serialization/util.clj 25 additions, 1 deletionsrc/metabase/models/serialization/util.clj
Loading
Please register or sign in to comment