Split out of PR-B2 (#317, PR #323) final review.
For a VCF/BCF whose INFO/AF carries multiple values for a (bi-allelic) record — an ambiguous ALT→AF mapping, e.g. a Number=. AF left un-subset after a bcftools norm -m split so G>A still lists AF=0.333,0.667 — the two paths currently diverge:
- Written (
gvl.write → _attach_af_column): declines to cache AF (warns), so Dataset.with_settings(min_af=…) raises the AF-missing guard.
- Streaming (
_VcfBackend.has_cached_af = header-only _declared_info_fields(("AF",))): reports AF available and reads it live, with genoray resolve_scalar returning the first value — so streaming silently filters where the written path raises.
This breaks the streaming⟺written byte-identity contract for such VCFs. It is narrow (non-standard Number=. AF) and gvl already documents a normalize-first requirement (docs/source/dataset.md caveat added in PR #323), so it was deferred, not blocking the merge.
Proposed fix: make streaming decline symmetrically — e.g. _VcfBackend.has_cached_af (or the VCF filler) detects multi-value AF and returns False so streaming raises the same guard as the written path. Add a streaming test twin of test_write_multivalue_af_writes_without_af_column.
Relates to #317, #319, PR #323.
Split out of PR-B2 (#317, PR #323) final review.
For a VCF/BCF whose
INFO/AFcarries multiple values for a (bi-allelic) record — an ambiguous ALT→AF mapping, e.g. aNumber=.AFleft un-subset after abcftools norm -msplit soG>Astill listsAF=0.333,0.667— the two paths currently diverge:gvl.write→_attach_af_column): declines to cache AF (warns), soDataset.with_settings(min_af=…)raises the AF-missing guard._VcfBackend.has_cached_af= header-only_declared_info_fields(("AF",))): reports AF available and reads it live, with genorayresolve_scalarreturning the first value — so streaming silently filters where the written path raises.This breaks the streaming⟺written byte-identity contract for such VCFs. It is narrow (non-standard
Number=.AF) and gvl already documents a normalize-first requirement (docs/source/dataset.mdcaveat added in PR #323), so it was deferred, not blocking the merge.Proposed fix: make streaming decline symmetrically — e.g.
_VcfBackend.has_cached_af(or the VCF filler) detects multi-value AF and returnsFalseso streaming raises the same guard as the written path. Add a streaming test twin oftest_write_multivalue_af_writes_without_af_column.Relates to #317, #319, PR #323.