Skip to content

geotiff: open_geotiff silently drops missing_sources when routing to read_vrt #1810

@brendancol

Description

@brendancol

Summary

open_geotiff does not accept missing_sources and does not forward it to read_vrt when dispatching to a .vrt source. Callers who want strict failure on broken VRT sources must call read_vrt directly, defeating the documented dispatcher.

Repro

from xrspatial.geotiff import open_geotiff
open_geotiff("mosaic.vrt", missing_sources="raise")
# TypeError: open_geotiff() got an unexpected keyword argument 'missing_sources'

Why this matters

Same class of bug as #1561 / #1605 / #1685 / #1795: a backend kwarg is reachable on the routed-to function but not through the documented dispatcher. #1806 added missing_sources to read_vrt but did not propagate it to open_geotiff. The VRT dispatch branch in xrspatial/geotiff/__init__.py:813-815 builds the forwarded call without it:

return read_vrt(source, dtype=dtype, window=window, band=band,
                name=name, chunks=chunks, gpu=gpu,
                max_pixels=max_pixels)

Proposed fix

Add missing_sources='warn' to open_geotiff, forward it to read_vrt, and reject it when the source is not a VRT (TIF or file-like) with a clear ValueError, matching the pattern open_geotiff already uses for on_gpu_failure and overview_level. The default 'warn' preserves historic behaviour.

Found during the geotiff API consistency sweep (Cat 5, MEDIUM).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions