Skip to content

Add basic caching of metricflow calls#1

Open
rfishermonteith wants to merge 2 commits into
entrypoint-rewritefrom
add-query-caching
Open

Add basic caching of metricflow calls#1
rfishermonteith wants to merge 2 commits into
entrypoint-rewritefrom
add-query-caching

Conversation

@rfishermonteith

Copy link
Copy Markdown
Owner

This uses joblib.Memory to cache the calls to mf query in generate_metric_sql (which are slow, and would otherwise be recomputed for every dbt call)

This uses the state of the upstream metrics and semantic models (from the manifest) to create a input hash for the function call. This way, the cache will be used iff:

  1. The input arguments are the same as an item in the cache
  2. The state of the metrics and semantic models used are identical

@boushphong

Copy link
Copy Markdown

Sorry I might need more time to review this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants