pull_requests: 1520596184
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1520596184 | PR_kwDOAMm_X85aonTY | 8208 | closed | 0 | Use a bound `TypeVar` for `DataArray` and `Dataset` methods | 5635139 | - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` Edit: I added a [comment](https://github.com/pydata/xarray/pull/8208#issuecomment-1725054516) outlining a problem with this --- I _think_ we should be using a `TypeVar(..., bound=...)` for our typing, since otherwise subtypes aren't allowed. I don't see a compelling reason to have all of `T_DataWithCoords` and `T_DataArrayOrSet` and `T_Xarray`, though I might be missing something. So this unifies all `T_DataWithCoords`, `T_DataArrayOrSet` and `T_Xarray` to `T_Xarray`, and changes that type to be bound on a union of `DataArray` & `Dataset` (similar to the existing `T_DataArrayOrSet`). This covers the bulk of our API — functions which transform either a `DataArray` or `Dataset` and return the input type. This does require some manual casts; I think because when there's a concrete path for both `DataArray` & `Dataset`, mypy doesn't unify them back together. It's also possible I'm missing something. One alternative — a minor change — would be to bound on `DataWithCoords`, like the existing `T_DataWithCoords`, rather than the union. A quick comparison showed each required some additional casts / ignores over the other. | 2023-09-19T03:46:33Z | 2023-09-28T16:46:54Z | 2023-09-19T19:20:42Z | 38a84cb6ffb131064a0c6fa65283653a9ebb89ff | 1 | ef42745261af6fd63669ea05e009c2bed63136ec | 828ea08aa74d390519f43919a0e8851e29091d00 | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/8208 |
Links from other tables
- 5 rows from pull_requests_id in labels_pull_requests