html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/pull/3298#issuecomment-531516313,https://api.github.com/repos/pydata/xarray/issues/3298,531516313,MDEyOklzc3VlQ29tbWVudDUzMTUxNjMxMw==,1217238,2019-09-14T21:46:22Z,2019-09-14T21:46:22Z,MEMBER,thanks @DangoMelon !,"{""total_count"": 2, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 2, ""rocket"": 0, ""eyes"": 0}",,491324262 https://github.com/pydata/xarray/pull/3298#issuecomment-531452036,https://api.github.com/repos/pydata/xarray/issues/3298,531452036,MDEyOklzc3VlQ29tbWVudDUzMTQ1MjAzNg==,1217238,2019-09-14T05:46:45Z,2019-09-14T05:46:45Z,MEMBER,"I would try to include value in the message, too, which can often be a useful hint about what went wrong, e.g., “expected positive integer for dimension ‘x’, got -1” On Fri, Sep 13, 2019 at 8:56 PM Gerardo Rivera wrote: > *@DangoMelon* commented on this pull request. > ------------------------------ > > In xarray/core/dataset.py > : > > > indexers = either_dict_or_kwargs(indexers, indexers_kwargs, ""head"") > + for v in indexers.values(): > + if not isinstance(v, int): > + raise TypeError(""indexer value must be an integer"") > + elif v < 0: > + raise ValueError(""indexer value must be positive"") > > Hmmm, Something along these lines maybe? > > ""expected integer as indexer value, found type %r for dim %r"" % (type(v), k) > > and > > ""expected positive integer as indexer value for dim %r"" % k > > The k and v come from iterating over indexers.items() > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > , > or mute the thread > > . > ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,491324262