DataJunction / dj

A metrics platform.
http://datajunction.io
MIT License
35 stars 15 forks source link

Fix retrieving cube SQL failure #1200

Closed shangyian closed 1 month ago

shangyian commented 1 month ago

Summary

There are two bugfixes in this PR:

(1) In some cases, retrieving cube SQL fails with this error:

greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place?

This is because the node object loaded from the database did not have cube metadata on it pre-loaded, like cube_elements.

(2) We should refresh the metrics SQL cache every time it's requested. Otherwise when we deploy changes to the SQL build, we won't keep the cache refreshed with the changes.

Test Plan

Tested locally

Deployment Plan

ASAP

netlify[bot] commented 1 month ago

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
Latest commit c9be191c6e4450556a368a515e3345b9fff6a8d8
Latest deploy log https://app.netlify.com/sites/thriving-cassata-78ae72/deploys/6708b969a8498000089c94de