Skip to content

VRT per-source read forwards allow_rotated into allow_invalid_nodata (bug from #2676) #2748

@brendancol

Description

@brendancol

Describe the bug

In xrspatial/geotiff/_vrt.py, the per-source (non-chunked) VRT read path forwards the wrong flag:

allow_invalid_nodata=allow_rotated,

It should forward allow_invalid_nodata:

allow_invalid_nodata=allow_invalid_nodata,

The chunked read path (_vrt_chunk_read) already forwards both flags correctly. Only the per-source path is affected.

Effect

A read_vrt(..., allow_invalid_nodata=True, allow_rotated=False) call does not actually relax nodata validation on the non-chunked path (it gets allow_rotated's value instead), and a caller passing allow_rotated=True would unintentionally also relax nodata validation there. Per-source metadata rejections (e.g. an invalid integer nodata sentinel) then surface as false holes under missing_sources='warn'.

Origin

Introduced by #2676 when forwarding the opt-in flags to VRT per-source reads for #2672. The (now closed) duplicate #2671 had this line correct.

Fix

Correct the one line and add a regression test asserting allow_invalid_nodata reaches the per-source read independently of allow_rotated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions