You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After a call to flowmachine.core.cache.reset_cache(), Query.get_stored() will return no queries. However, the is_stored() method of the events.{calls,mds,sms} table objects will return True. As a result, these tables will appear in the set returned by queries' _get_stored_dependencies() method, and calling query.store().result() will raise an error:
psycopg2.errors.ForeignKeyViolation: insert or update on table "dependencies" violates foreign key constraint "cache_dependency_id"
DETAIL: Key (depends_on)=(70a2d392f73aedcc251a6a504f17008a) is not present in table "cached".
So Query.get_stored() doesn't include the events tables any more, but dl_query._get_stored_dependencies() still does. If we now try to store the daily location query, we get an error:
Expected behavior
Presumably we don't want to remove the events.{calls,mds,sms} tables when resetting the cache, so cache.cached should still know about these tables.
The text was updated successfully, but these errors were encountered:
Mm. Ok, this arises because the is_stored property of all Table objects is True, but they only call self._db_store_cache_metadata() in their constructor. So here, because the Table objects already exist, they won't put themselves back in cache.
Describe the bug
After a call to
flowmachine.core.cache.reset_cache()
,Query.get_stored()
will return no queries. However, theis_stored()
method of theevents.{calls,mds,sms}
table objects will returnTrue
. As a result, these tables will appear in the set returned by queries'_get_stored_dependencies()
method, and callingquery.store().result()
will raise an error:To Reproduce
So
Query.get_stored()
doesn't include the events tables any more, butdl_query._get_stored_dependencies()
still does. If we now try to store the daily location query, we get an error:Expected behavior
Presumably we don't want to remove the
events.{calls,mds,sms}
tables when resetting the cache, socache.cached
should still know about these tables.The text was updated successfully, but these errors were encountered: