home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 975385095

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
975385095 MDU6SXNzdWU5NzUzODUwOTU= 5721 pandas deprecates Index.get_loc with method 10194086 closed 0     7 2021-08-20T08:24:16Z 2022-01-27T21:06:40Z 2022-01-27T21:06:40Z MEMBER      

pandas deprecates the method keyword in Index.get_loc, see pandas-dev/pandas#42269. Therefore we end up with about 5000 warnings in our upstream tests:

FutureWarning: Passing method to Index.get_loc is deprecated and will raise in a future version. Use index.get_indexer([item], method=...) instead

We should fix this before pandas releases because the warning will not be silent (FutureWarning) or ask pandas to give us more time and use a DeprecationWarning at the moment.

We use this here: https://github.com/pydata/xarray/blob/4bb9d9c6df77137f05e85c7cc6508fe7a93dc0e4/xarray/core/indexes.py#L233-L235 Is this only ever called with one item? Then we might be able to use ```python indexer = self.index.get_indexer( [label_value], method=method, tolerance=tolerance ).item() if indexer == -1: raise KeyError(label_value) ``` --- https://github.com/pydata/xarray/blob/3956b73a7792f41e4410349f2c40b9a9a80decd2/xarray/core/missing.py#L571-L572 This one could be easy to fix (replace with `imin = index.get_indexer([minval], method="nearest").item()`) --- It is also defined in `CFTimeIndex`, which complicates things: https://github.com/pydata/xarray/blob/eea76733770be03e78a0834803291659136bca31/xarray/coding/cftimeindex.py#L461-L466 because `get_indexer` expects an iterable and thus the `if isinstance(key, str)` test no longer works.

@benbovy @spencerkclark

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5721/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 7 rows from issue in issue_comments
Powered by Datasette · Queries took 0.869ms · About: xarray-datasette