You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opening s3 file with rasterio 1.4 immediately loads the data to the machine #824
We used to open the file connection to the file stored on s3 and then passing it to open_rasterio. A change in 1.4 now immediately loads all the data to the local machine and then puts it completely into the dask graph, making it explode in size
This behavior is sub-optimal, it slows us down on the client and then create a huge dask graph. The new recommended way of dealing with this is as follows:
Ideally, the opener would be set automatically whenever fsspec is installed and potentially raise a warning if rasterio >=1.4 and a remote /local file is passed that runs into this condition so that users now what to do
Can we at least raise a warning if an already opened remote file is passed that is now automatically loaded into memory pointing to the workaround? I am mostly worried about foot guns for users that run into this similar to how I ran into it.
Activity
snowman2 commentedon Nov 1, 2024
Not all users want this behavior as GDAL handles S3 files natively. I think the current behavior is fine with the workaround you have identified.
This is the current recommended approach, correct?
phofl commentedon Nov 1, 2024
Hm that makes sense. Didn't think about GDAL.
Can we at least raise a warning if an already opened remote file is passed that is now automatically loaded into memory pointing to the workaround? I am mostly worried about foot guns for users that run into this similar to how I ran into it.
snowman2 commentedon Nov 1, 2024
I am not aware of a good way to do that as users may actually want to load the whole file into memory.
phofl commentedon Nov 1, 2024
This is definitely an anti pattern is chunks is passed as well and something you should never do. That case seems sensible enough to warn about