What is a Transform Model?
A model in Transform is the complete representation of the configurations of your data sources and metrics that you commit to Transform. When you change your data source configuration or metrics in Transform, you create a new version of the Transform Model.
Which model will my metrics be created from?
Your Transform server will store a primary model that will be used to fulfill metric requests from all interfaces i.e. API requests from the CLI or requests from the Transform UI. Your primary model is built from the configs you have in your Transform repo and gets built when a PR is merged via our CI/CD with GitHub actions. You can view the current primary model id by running the following query in the API explorer:
query {
myOrganization {
currentModel {
id
}
}
}
How do I test changes to my model locally?
Changes to your YAML configs will be not be reflected in your production model until you merge them to your transform repo and deploy changes via GitHub actions. To test local changes in your configs, you can add the --config-dir <path-to-transform-directory>
option to your query request. This will tell Transform to build your model based on your local configs.
mql query --metrics example_metric --dimensions metric_time --config-dir model --limit 10
If you want every local API request to use your local configs, you can "pin" your model. Pinning a model means the Transform server will use this model by default for your user. It does not effect other users querying in the UI or from another interface. To do this run mql commit-configs
and select y
when asked if you would like to pin your model.