home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 187560717

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
187560717 MDU6SXNzdWUxODc1NjA3MTc= 1082 Issue a warning when overwriting attributes with accessors instead of erroring 1217238 closed 0     1 2016-11-06T13:11:52Z 2019-01-08T21:59:36Z 2019-01-08T21:59:36Z MEMBER      

On the mailing list, @rabernat wrote:

Also, how can I interactively develop an accessor? If I try to re-register under the same name, I get the error AccessorRegistrationError: cannot register accessor <class '__main__.ExchAccessor'> under name 'exch' for type <class 'xarray.core.dataset.Dataset'> because an attribute with that name already exists.

In #1080, @smartass101 suggests:

Btw, perhaps it might be better to (perhaps optionally) issue a warning when overriding an existing class attribute during registering instead of completely refusing to do so.

I think this is a good idea, and would nicely solve @rabernat's problem (which might be your problem, too). We could add a new keyword argument (e.g., allow_override=True or warn=True to register_*_accessor) which switches to this new mode.

Should it be the default behavior? It is also possible that warnings instead of errors are enough in general.

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

Links from other tables

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