-
Notifications
You must be signed in to change notification settings - Fork 419
Description
Would it be helpful to standardize the ability to set the content type of files written by fsspec? Several backends have / are requesting the ability to set this (https://github.com/fsspec/s3fs/blob/4f289eaa34dfe8337a72f5a0148c41a44793fde0/s3fs/core.py#L971-L974, fsspec/adlfs#294). Each backend will typically have a different "native" was for setting things. With S3 it's a ContentType keyword. With azure, it's content_settings=azure.storage.blob.ContentSettings(content_type=...).
This proposal would make content_type a proper keyword of pipe, put, (and any others writing data). The backend would be responsible for setting it appropriately.
We might also need to standardize a default behavior. s3fs uses a library to guess the content type. I'm not sure if that's appropriate (if it were, I'd think that boto / azure-storage-blob would do it?).