home / github / pull_requests

Menu
  • Search all tables
  • GraphQL API

pull_requests: 280120723

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
280120723 MDExOlB1bGxSZXF1ZXN0MjgwMTIwNzIz 2972 open 0 ENH: Preserve monotonic descending index order when merging 13662783 * Addresses GH2947 * When indexes were joined in a dataset merge, they would always get sorted in ascending order. This is awkward for geospatial grids, which are nearly always descending in the "y" coordinate. * This also caused an inconsistency: when a merge is called on datasets with identical descending indexes, the resulting index is descending. When a merge is called with non-identical descending indexes, the resulting index is ascending. * When indexes are mixed ascending and descending, or non-monotonic, the resulting index is still sorted in ascending order. <!-- Feel free to remove check-list items aren't relevant to your change --> - [x] Closes #2947 - [x] Tests added - [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ## Comments I was doing some work and I kept running into the issue described at #2947, so I had a try at a fix. It was somewhat of a hassle to understand the issue because I kept running into seeming inconsistencies. This is caused by the fact that the joiner doesn't sort with a single index: ```python def _get_joiner(join): if join == 'outer': return functools.partial(functools.reduce, operator.or_) ``` That makes sense, since I'm guessing `pandas.Index.union` isn't get called at all. (I still find the workings of `functools` a little hard to infer.) I also noticed that an outer join gets called with e.g. an `.isel` operation, even though there's only one index (so there's not really anything to join). However, skipping the join completely in that case makes several tests fail since dimension labels end up missing (I guess the `joiner` call takes care of it). It's just checking for the specific case now, but it feels like an very specific issue anyway... The merge behavior is slightly different now, which is reflected in the updated test outcomes in `test_dataset.py`. These tests were turning monotonic decreasing indexes into an increasing index; now the decreasing order is maintained. 2019-05-18T19:12:11Z 2022-06-09T14:50:17Z     2a59cd7f1745469e18f9914ce9b5a6f46e4feac2     0 c4bab220bdfa8c3e4c3f042c59dd3a7203ac4149 d1e4164f3961d7bbb3eb79037e96cae14f7182f8 CONTRIBUTOR   13221727 https://github.com/pydata/xarray/pull/2972  

Links from other tables

  • 0 rows from pull_requests_id in labels_pull_requests
Powered by Datasette · Queries took 1.574ms