Graph.snapshot() reused an existing index whenever the tables' data
versions matched. A version of kind unknown (a plain str from a
plugin, an undated BigQuery table, a single object with no mtime)
can stay the same after its data changes, so such a snapshot was
reused indefinitely.
When any table's version kind is unknown, fold a fresh token into
data_version: the call builds a new index with a new id that no later
call matches, and logs which tables caused it. Other kinds keep
reusing, and earlier snapshots are untouched.
What
Graph.snapshot()reuses an existing index whenever every table's data version matches the one it was built from. A version of kindunknown(an undated BigQuery table, a single object with no modification time, or a source plugin returning a plainstr) can stay the same after its data changes, so such a snapshot is reused indefinitely and serves stale data. This PR rebuilds snapshots overunknownversions on every call.exact,timestamp,listingandhour_bucketversions keep reusing, and the drift report is unchanged.unknown,snapshot()folds a fresh token intodata_version, so the call builds a new index with a new id that no later call matches. Earlier snapshots and their indexes are untouched.Why
A plain version string only promises that unchanged data gives the same value, not that changed data gives a different one, so it can't justify reusing an index.
version_kindalready marks such versionsunknown, and the drift report already refuses to compare them; reuse ignored the kind.Change map
File-by-file change map.
Testing Done
test_snapshot_reuses_an_index_only_over_known_versions, with real ingest from local files: graphs withexact/timestampandlisting/hour_bucketversions reuse their index; a plainstr,SourceVersion('-1')and a mixed graph each rebuild with a new id, leave the earlier index in place and log the tables. The rebuild cases fail on main.