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/6715#issuecomment-1180875642,https://api.github.com/repos/pydata/xarray/issues/6715,1180875642,IC_kwDOAMm_X85GYrt6,34722076,2022-07-11T21:12:58Z,2022-07-11T21:12:58Z,NONE,"Inspired by this commend https://github.com/rasterio/rasterio/issues/2490#issuecomment-1164700425 from @snowman2, files opened with `xr.open_rasterio` needs to be closed to prevent io locking. Loading the data into memory and close the file after reading resolves the issue, see the last code snippet here https://xarray.pydata.org/en/v0.7.1/io.html:
```with xr.open_rasterio(path) as ds:
# load all data from the transformed dataset, to ensure we can
# use it after closing each original file
ds.load()
return ds```","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1280507371