Skip to main content

Developing a Transform Project

This guide assumes you have deployed your Transform project and downloaded your Transform git repo to your local machine. If you have not completed these steps, check out the deployment guide.

First, open a new terminal window and navigate to your Transform directory. We have a CLI interface that will allow you to query metrics from your Transform server. You can read more about the CLI interface here.

We recommend installing the Transform CLI in a virtual environment to avoid any python environment dependency issues.

Run the following commands to set up a virtual environment and activate it. If you don't want to check your virtual environment into git, you can add the directory to your .gitignore file.

python3 -m venv venv && source venv/bin/activate

Next, install Transform.

pip install transform

Finally, you need to authenticate to your Transform server. Run the following command and follow the prompts in your terminal. You will need your Transform API key for this step. You can view and manage your Transform API keys here.

mql setup

To view the available commands for the CLI run

mql --help
    Usage: mql [OPTIONS] COMMAND [ARGS]...

Options:
-v, --verbose
-y, --skip-confirm
--debug-log-file
--help Show this message and exit.

Commands:
commit-configs Commit yaml configs found in specified...
contact Instructions for how to contact Transform...
data-warehouse-validations Run data warehouse validations for a model,...
drop-cache Drop the MQL cache.
drop-materialization ***NEW*** Create a new MQL drop...
get-dimension-values List all dimension values that are...
health-report Completes a health check on MQL servers.
identify Identify the currently authenticated user.
install-completion Install command completion for the MQL CLI
invalidate-caches Invalidates caches
latest-mql-image Outputs the latest MQL server image details
list-dimensions List all unique dimensions for the...
list-materializations List the materializations for the...
list-metrics List the metrics for the Organization with...
list-queries Retrieve queries from mql server
list-servers Lists available MQL servers.
materialize Create a new MQL materialization query,...
pin-model Pin a model id from configs that are...
ping Perform basic HTTP health check against...
query Create a new MQL query, polls for...
setup Guides user through CLI setup.
stream-query-logs Retrieve queries from mql server
unpin-model Unpin a model id
validate-configs Validate yaml configs found in specified...
version Print the current version of the MQL CLI.

You should now be ready to query metrics and develop Transform locally.