Materializing Metrics using Python
Materializations are invoked through the interfaces and scheduled to run at a cadence. The configuration for the materialization must already exist in your Transform configurations in order for you to run this command. For more information on Materializations, see here.
Usage
Examples
The materialization-name should map to the one committed in your Transform directory. If you don't provide a start and end-time, the materialization will run across all available data, which can be very expensive.
from transform import mql
mql.materialize("transaction_metrics") # synchronous
mql.create_materialization("transaction_metrics") # asynchronous
Providing a start and end time will bound the data for the materialization.
mql.materialize("transaction_metrics", start_time="2020-01-01", end_time="2020-01-31")
By default, the materialization will write to the Transform schema and any other location you've specified in the destinations for your configuration. Optionally provide a specific schema and table to write the materialization to. Note this won't be managed by Transform once it's written outside our cache.
mql.materialize("transaction_metrics", start_time="2020-01-01", end_time="2020-01-31", output_table="my_schmea.my_table")