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

fix: case sensitive file extension checks and force them to lower cas… #201

Closed
wants to merge 2 commits into from

Conversation

FHardow
Copy link
Member

@FHardow FHardow commented Jun 25, 2024

…e on upload

Related Issues

Proposed Changes?

Force the file extension to be lower case to check against allowed extensions and on upload. All other checks, like checking for metadata files are left untouched.

How did you test it?

Adjusted unit tests.

Notes for the reviewer

Screenshots (optional)

Checklist

  • I have updated the referenced issue with new insights and changes
  • If this is a code change, I have added unit tests
  • I've used the conventional commit specification for my PR title
  • I updated the docstrings
  • If this is a code change, I added meaningful logs and prepared Datadog visualizations and alerts

Copy link

swarmia bot commented Jun 25, 2024

Copy link

github-actions bot commented Jun 25, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  deepset_cloud_sdk/_service
  files_service.py
Project Total  

This report was generated by python-coverage-comment-action

Copy link
Member

@ArzelaAscoIi ArzelaAscoIi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write/adjsut an integration test that:

  • uploads an example.TXT
  • uploads an example.txt
  • uploads an example.TXT.meta.json

and checks that only the example.TXT has the correct metadata ?

@mathislucka
Copy link
Member

and checks that only the example.TXT has the correct metadata ?

Are we considering lower and upper case to be different files then?

I think that wouldn't be immediately obvious to me as a user.

@FHardow
Copy link
Member Author

FHardow commented Jun 26, 2024

Hey @mathislucka
I added a comment in the ticket.

Are we considering lower and upper case to be different files then?

We probably need to. It depends on your file system how case sensitivity is treated. We can't enforce a casing on upload without running into the problem of overwriting data.

@FHardow
Copy link
Member Author

FHardow commented Jun 27, 2024

We decided that we will not continue on this fix and document that customers files need to end with lower cased extensions.

@FHardow FHardow closed this Jun 27, 2024
@mathislucka
Copy link
Member

Could we add an explicit warning to the upload command? I'm afraid that users won't check the documentation.

@agnieszka-m
Copy link
Contributor

The warning could say: Make sure your files have lowercase extensions, for example, my_file.pdf, instead of my_file.PDF. The SDK doesn't upload files with uppercase extensions.

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

Successfully merging this pull request may close these issues.

4 participants