Skip to content

geotiff: remove deprecated attrs emission and bump contract version to 2 (issue #1984 removal phase) #2016

@brendancol

Description

@brendancol

Background

PR 7 of issue #1984 ran the four deprecation slices in warning-only mode:

Each emission still lands on DataArray.attrs; each emission also fires a DeprecationWarning pointing at this issue. The four slices documented removal as "scheduled for a future release."

After the next release ships and the warning-only window closes, the read-side emission of those 13 attrs needs to be removed.

Proposal

Land one PR per slice (mirrors the warning-only structure), each containing:

  • Remove the emission in xrspatial/geotiff/_attrs.py::_populate_attrs_from_geo_info: drop the _emit_deprecated_* call.
  • Update the locking tests in xrspatial/geotiff/tests/test_attrs_contract_passthrough_1984.py: the affected attrs move from "expected to drop" (because of writer gap) to "never emitted" (reader no longer surfaces them at all). Update _ALL_PASSTHROUGH_KEYS and _PASSTHROUGH_CASES accordingly.
  • Drop the warning-only tests test_attrs_pr7_deprecate_*_1984.py once the corresponding reader emission is gone.
  • Update the docstring + RST so the deprecated keys move from "Deprecated" to a brief "Removed in vX.Y" historical note.
  • Bump _ATTRS_CONTRACT_VERSION from 1 to 2 in the final slice that lands (whichever is last). Update test_attrs_contract_version_1984.py to pin 2.
  • CHANGELOG: one entry per slice noting the removal.

Alternative: one consolidated removal PR. Smaller diff overall, but a single review across four tiers. The split mirrors the deprecation-phase split and lets reviewers focus per axis.

Acceptance criteria

  • Reading a TIFF carrying any of the 13 secondary GeoKey / palette attrs returns a DataArray whose attrs does NOT contain the removed key.
  • No DeprecationWarning for any of the 13 attrs anywhere in the read paths.
  • attrs['_xrspatial_geotiff_contract'] == 2 on every read.
  • The four warning-only test files have been deleted (their behaviour is now "attr is absent" pinned by the passthrough locking test).
  • docs/source/user_guide/attrs_contract.rst reflects the new state: deprecated tier is empty or removed; an "Historical: removed in vX.Y" footnote lives elsewhere (or in the changelog).
  • Downstream xrspatial.geotiff test suite passes with no warnings for the removed attrs.

Sequencing

This work must wait until the deprecation warning has shipped in at least one tagged release so external callers have had a chance to migrate. Once that release goes out, label this issue as ready and the four slices can land in parallel.

Migration safety

External callers reading those attrs after removal will see KeyError if they access them with attrs[key] instead of attrs.get(key). The deprecation warning text in PR 7 explicitly tells callers to migrate to crs / crs_wkt plus pyproj (or to attrs['colormap'] plus a one-liner for the matplotlib variants), and docs/source/user_guide/attrs_contract.rst carries the recipes. No silent behavioral change should reach an unprepared caller.

Refs #1984.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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