Fix rasterio rowcol operation return type - #16352
Conversation
This comment has been minimized.
This comment has been minimized.
| **rpc_options: _GDALOption, | ||
| ) -> tuple[float, float] | tuple[list[float], list[float]]: ... | ||
|
|
||
| @overload |
There was a problem hiding this comment.
Astra thinks this is wrong:
index() must not propagate the callback’s return type. Its implementation explicitly returns
tuple(int(val) for val in rowcol(...)). Even with a float-returning operation, index() returns integers. Separate its annotation from rowcol’s.
There was a problem hiding this comment.
Fixed. TransformMethodsMixin.index() now keeps its integer return type and accepts callbacks returning ConvertibleToInt; only the rowcol() APIs propagate the callback return type. I also added regression assertions covering a float-returning callback for both paths and reran the targeted mypy, Pyright, stubtest, and multi-version checks.
364da14 to
afdb012
Compare
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Closes #16342.
Preserve the default integer result while propagating a custom operation's return type through
rowcolandindex.Agent used: OpenAI Codex.