Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update core.py #849

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update core.py #849

wants to merge 2 commits into from

Conversation

obronco
Copy link

@obronco obronco commented Feb 13, 2024

Refactor the code to improve mime type guessing by utilizing the destination file instead of relying on the source file. This change was prompted by the inconvenience of having uncompressed Minio objects when the source was a .tmp file that I would subsequently copy to .txt or .csv format.

Based on the observation, it seems there shouldn't be any drawbacks to this change, as the scenarios considered are:

  1. Local files with unknown extensions being transferred to remote locations with known extensions like .txt, .csv, .json, or .zip.
  2. Cases where both local and remote files have the same known extension.

The question arises: Does anyone currently utilize the scenario where local files have known extensions while remote files have unknown extensions?

Refactor the code to improve mime type guessing by utilizing the destination file instead of relying on the source file. This change was prompted by the inconvenience of having uncompressed Minio objects when the source was a .tmp file that I would subsequently copy to .txt or .csv format.
s3fs/core.py Outdated Show resolved Hide resolved
I´m not really seeing the use case, but seems harmless enough.

Co-authored-by: Martin Durant <[email protected]>
@martindurant
Copy link
Member

Can we have a test for this please, now with an inferable path name for local, remote, and both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants