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
{{ message }}
Repository navigation
Cache: invalidate a cache=True source when its data changes #39
A source registered with cache=True asserts that its data is static for the process lifetime. Nothing checks that. The response cache, the cube cache, the resolved min/max bounds and the sorted flag on LFQueryBuilder all live until the process ends or the source is re-registered with raw data or a new builder. Re-registering the same builder object invalidates nothing and only warns (flexviz/server.py, register_source).
Architecture.md and the register_source docstring cite issue #27 for this. #27 is a pull request. This issue replaces that reference.
Proposal
Pick one of:
A fingerprint per source (file size and mtime for a local Parquet scan; the frame id for a resident frame), checked on each request and used to drop every cache entry keyed on that source when it changes.
An explicit invalidate(name) endpoint and CLI command, with no automatic check.
Option 2 is smaller and keeps the static-data contract explicit. Option 1 is what a user who edits a file expects.
Done when
A changed file behind a cache=True scan is served fresh after invalidation, including its bounds and sorted flag.
Re-registering the same builder object with cache=True drops the stale entries instead of warning.
The docs name the chosen behaviour and the limits.
An in-place overwrite fails in the same way. After the first collect, the scan_parquet LazyFrame keeps the metadata of the old file. A new scan reads the new file.
Through FlexViz (a source registered with scan_parquet, mounted, file replaced while the server runs):
cache=False: every /dashboard/update returns 500, from a panic in the streaming Parquet source. The panels stay empty.
cache=True: a new page shows the old first view.
Consequence for this issue: dropping the FlexViz caches does not make a changed file readable through the registered LazyFrame. Invalidation must also rebuild the scan. Until then, the docs tell users to restart the server after the data changes (web apps guide in #141).
Activity
jvdd commentedon Oct 1, 2026
Finding from the review of #141: the Polars scan goes stale too, not only the FlexViz caches.
Repro (pure Polars 1.44.2, no FlexViz):
An in-place overwrite fails in the same way. After the first collect, the
scan_parquetLazyFrame keeps the metadata of the old file. A new scan reads the new file.Through FlexViz (a source registered with
scan_parquet, mounted, file replaced while the server runs):cache=False: every/dashboard/updatereturns 500, from a panic in the streaming Parquet source. The panels stay empty.cache=True: a new page shows the old first view.Consequence for this issue: dropping the FlexViz caches does not make a changed file readable through the registered LazyFrame. Invalidation must also rebuild the scan. Until then, the docs tell users to restart the server after the data changes (web apps guide in #141).