Closed shangyian closed 3 months ago
Name | Link |
---|---|
Latest commit | c88f1af2eba1278b63c5b19e1436c9caf8f360f9 |
Latest deploy log | https://app.netlify.com/sites/thriving-cassata-78ae72/deploys/667a2703af6785000822e5a7 |
@agorajek and @samredai going to merge this now to get it in, but feel free to leave comments and I'll address them in a follow-up PR
Summary
This PR adds a feature to generate a notebook for exporting cubes and namespaces. For cubes, the generated notebook will include all nodes referenced by the cube, i.e., all metrics and their upstream transforms. By default this export excludes sources and dimensions, but these can be included with a flag. For namespaces, the generated notebook includes all nodes in the namespace.
In the exported notebook, users can modify
NAMESPACE_MAPPING
to map current namespaces to new ones and rerun the notebook to recreate the nodes in those new namespaces. For each exported node with a query, we will modify the query to replace the node names with the namespace mapping as an f-string. This does mean that queries with comments will have the comments stripped in the exported versions.These changes also switch to using jinja templates for the generated client code snippets. This makes it easier to read, as generating them through string manipulation was difficult to maintain.
Test Plan
Ran locally
make check
passesmake test
shows 100% unit test coverageDeployment Plan
N/A