home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1200925682

This data as json

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/issues/6852#issuecomment-1200925682 https://api.github.com/repos/pydata/xarray/issues/6852 1200925682 IC_kwDOAMm_X85HlKvy 14808389 2022-08-01T09:06:16Z 2022-08-01T09:11:52Z MEMBER

bisecting tells me this is a regression introduced by #6389. Looking at the code, this happens because copying the variables with variables.copy() makes a shallow copy of the dictionary (and not its values), which means that we're actually mutating the Dataset variables. If I change that line to ```python

make a shallow copy of each variable

new_variables = {name: var.copy() for name, var in variables.items()} ``` we stop mutating the dataset.

cc @benbovy

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1323521079
Powered by Datasette · Queries took 2.656ms · About: xarray-datasette