(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.
Summary
There are two bugfixes in this PR:
(1) In some cases, retrieving cube SQL fails with this error:
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
make check
passesmake test
shows 100% unit test coverageDeployment Plan
ASAP