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/6974#issuecomment-1450715249,https://api.github.com/repos/pydata/xarray/issues/6974,1450715249,IC_kwDOAMm_X85WeChx,19718721,2023-03-01T19:12:12Z,2023-03-01T19:12:12Z,NONE,"It would be great to further improve this by handling file-like objects. I am running into an issue when trying to read some data from S3 buckets. I can pass in a file-like object and read the data, but there is no `.encoding['source']` in the subsequent dataset. Can simulate this 'issue' using local data: > import xarray as xr > file = '/path/to/file.nc' > fid = open(file, 'rb') > ds = xr.open_dataset( fid, engine='h5netcdf' ) This will have no source encoding in the dataset, but it could be grabbed from `fid.name`. Could a check be added for file-like objects, and then insert the `.path` or `.name` attribute into `.encoding['source']`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1358247997 https://github.com/pydata/xarray/pull/6974#issuecomment-1244589007,https://api.github.com/repos/pydata/xarray/issues/6974,1244589007,IC_kwDOAMm_X85KLuvP,10194086,2022-09-12T22:15:10Z,2022-09-12T22:15:10Z,MEMBER,"Let's see if that works now - should auto-merge on green. Thanks for your contribution and welcome to xarray!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1358247997 https://github.com/pydata/xarray/pull/6974#issuecomment-1242877683,https://api.github.com/repos/pydata/xarray/issues/6974,1242877683,IC_kwDOAMm_X85KFM7z,15375218,2022-09-11T03:32:21Z,2022-09-11T03:32:21Z,CONTRIBUTOR,"> I think it's also possible to pass the whole dataset as bytes & we don't want this to end off in `ds.encoding[""source""]` I hope my suggestion would take care of this. Thanks. I had forgotten you could, for example, pass file-like objects as I don't tend to. I've confirmed your suggestion works and have added it to the change. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1358247997