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

Quote all first characters the Dataverse cannot handle #272

Merged
merged 2 commits into from
Mar 17, 2023

Conversation

christian-monch
Copy link
Contributor

Datavers has the peculiar habit of removing leading ., -, and from file names. This PR ensures that all three characters are escaped, if they are at the start of a file name. Previously only . was escaped.

Datavers has the peculiar habit of removing
leading '.', '-', and ' ' from file names.
This commit ensures that all three characters
are escaped, if they are at the start of a
file name. Previously only "." was escaped.
@mih
Copy link
Member

mih commented Mar 17, 2023

Thx! I will wait till #273 is tested and merge, then rerun the tests here, and then merge.

@mih
Copy link
Member

mih commented Mar 17, 2023

In general, it is nice that this is all self-contained and tested within. However, it would be good to have an explicit test that actually puts a problematic file on dataverse and gets it back.

Ping #202

This PR adds tests that use "difficult" names in
combination with a real dataverse instance
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2023

Codecov Report

Patch coverage: 97.77% and project coverage change: +0.29 🎉

Comparison is base (650e930) 93.39% compared to head (699f6cf) 93.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #272      +/-   ##
==========================================
+ Coverage   93.39%   93.69%   +0.29%     
==========================================
  Files          17       17              
  Lines         909      968      +59     
==========================================
+ Hits          849      907      +58     
- Misses         60       61       +1     
Impacted Files Coverage Δ
datalad_dataverse/tests/test_dataset.py 99.18% <96.42%> (-0.82%) ⬇️
datalad_dataverse/tests/test_utils.py 100.00% <100.00%> (ø)
datalad_dataverse/utils.py 94.11% <100.00%> (+0.29%) ⬆️

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@christian-monch
Copy link
Contributor Author

Added simple tests, working on tests with directory-labels

Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

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

Thx for the fix!

@mih mih merged commit 5a16210 into datalad:main Mar 17, 2023
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.

3 participants