home / github / pull_requests

Menu
  • GraphQL API
  • Search all tables

pull_requests: 311663986

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
311663986 MDExOlB1bGxSZXF1ZXN0MzExNjYzOTg2 3271 closed 0 Raise proper error for scalar array when coords is a dict 23618263 <!-- Feel free to remove check-list items aren't relevant to your change --> As explained here https://github.com/pydata/xarray/pull/3159#discussion_r316230281 , when a user uses a scalar array to build a `DataArray` with `coords` given as a dictionary the error is not self explanatory. ```python >>> xr.DataArray(np.array(1), coords={'x': np.arange(4), 'y': 'a'}, dims=['x']) ... KeyError: 'x' ``` This PR makes sure that when `data` is a scalar array and `dims` is not empty, it sets the shape to `(0,)` to make it fail with the proper raise message ```python >>> xr.DataArray(np.array(1), coords={'x': np.arange(4), 'y': 'a'}, dims=['x']) ... ValueError: conflicting sizes for dimension 'x': length 0 on the data but length 4 on coordinate 'x' ``` - [x] Test updated - [x] Passes `black . && mypy . && flake8` - [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API (is this needed for a change like this?) 2019-08-28T04:29:02Z 2019-08-29T17:23:20Z 2019-08-29T17:09:00Z 2019-08-29T17:09:00Z f8647183c49c806896a2c94d12c5df56cb7f389e     0 f42f73f23812a2498cca2b618d1fe5323ff60e96 8969b5a974723dc13ce93db1e878f791764f539e CONTRIBUTOR   13221727 https://github.com/pydata/xarray/pull/3271  

Links from other tables

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