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

?location parameter in URLs can only point to a folder #1305

Merged
merged 5 commits into from
Oct 21, 2023

Conversation

yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Jun 15, 2023

Per @AlmightyYakob observation in
dandi/dandi-archive#1546 (comment)

If you don't see a problem with such an approach, please finish it up (leaner code if any , tests) @jwodder so we could declare that issue in the archive addressed.

Closes #1256

@jwodder jwodder marked this pull request as draft June 15, 2023 13:13
@jwodder jwodder added the patch Increment the patch version when merged label Jun 15, 2023
@jwodder jwodder changed the title "Hardcode" the knowledge that location= option in URL can only point to the folder ?location parameter in URLs can only point to folders Jun 15, 2023
@jwodder jwodder added minor Increment the minor version when merged Python API and removed patch Increment the patch version when merged labels Jun 15, 2023
@jwodder jwodder changed the title ?location parameter in URLs can only point to folders ?location parameter in URLs can only point to a folder Jun 15, 2023
@jwodder jwodder force-pushed the enh-location-folder branch from 69ac203 to 9007788 Compare June 15, 2023 13:40
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c3f9524) 88.78% compared to head (24901a9) 88.78%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1305   +/-   ##
=======================================
  Coverage   88.78%   88.78%           
=======================================
  Files          76       76           
  Lines       10216    10220    +4     
=======================================
+ Hits         9070     9074    +4     
  Misses       1146     1146           
Flag Coverage Δ
unittests 88.78% <77.77%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
dandi/tests/test_dandiarchive.py 100.00% <ø> (ø)
dandi/dandiarchive.py 85.22% <77.77%> (+0.20%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jwodder jwodder marked this pull request as ready for review June 15, 2023 14:24
@jwodder
Copy link
Member

jwodder commented Jun 15, 2023

@yarikoptic Done.

dandi/dandiarchive.py Outdated Show resolved Hide resolved
@yarikoptic
Copy link
Member Author

8 type checking errors all seems to relate to changed requests "API" and to be addressed in https://github.com//pull/1336
2023-10-20T16:01:19.7395937Z typing: commands[0]> mypy dandi
2023-10-20T16:01:35.3761604Z dandi/dandiapi.py:251: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.3764882Z attribute "status_code"  [union-attr]
2023-10-20T16:01:35.3861802Z                         e.response.status_code,
2023-10-20T16:01:35.3862427Z                         ^~~~~~~~~~~~~~~~~~~~~~
2023-10-20T16:01:35.3863374Z dandi/dandiapi.py:254: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.3864704Z attribute "text"  [union-attr]
2023-10-20T16:01:35.3865208Z                         e.response.text,
2023-10-20T16:01:35.3865952Z                         ^~~~~~~~~~~~~~~
2023-10-20T16:01:35.3866822Z dandi/files/bases.py:365: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.3867678Z attribute "status_code"  [union-attr]
2023-10-20T16:01:35.3868292Z                 if e.response.status_code == 409:
2023-10-20T16:01:35.3869179Z                    ^~~~~~~~~~~~~~~~~~~~~~
2023-10-20T16:01:35.3870091Z dandi/files/bases.py:367: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.3870953Z attribute "headers"  [union-attr]
2023-10-20T16:01:35.3871699Z                     blob_id = e.response.headers["Location"]
2023-10-20T16:01:35.3872486Z                               ^~~~~~~~~~~~~~~~~~
2023-10-20T16:01:35.3873254Z dandi/files/zarr.py:302: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.3874325Z attribute "text"  [union-attr]
2023-10-20T16:01:35.3875873Z                     if "Zarr already exists" in e.response.text:
2023-10-20T16:01:35.3876611Z                                                 ^~~~~~~~~~~~~~~
2023-10-20T16:01:35.5375668Z dandi/dandiarchive.py:168: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.5377058Z attribute "status_code"  [union-attr]
2023-10-20T16:01:35.5377915Z                     if e.response.status_code == 401 and authenticate is n...
2023-10-20T16:01:35.5379166Z                        ^~~~~~~~~~~~~~~~~~~~~~
2023-10-20T16:01:35.5380197Z dandi/dandiarchive.py:296: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.5381093Z attribute "status_code"  [union-attr]
2023-10-20T16:01:35.5382293Z                     if e.response.status_code == 401 and authenticate is n...
2023-10-20T16:01:35.5383660Z                        ^~~~~~~~~~~~~~~~~~~~~~
2023-10-20T16:01:35.8677309Z dandi/download.py:703: error: Item "None" of "Optional[Response]" has no
2023-10-20T16:01:35.8678560Z attribute "status_code"  [union-attr]
2023-10-20T16:01:35.8679978Z                 if attempt >= 2 or exc.response.status_code not in (
2023-10-20T16:01:35.8680963Z                                    ^~~~~~~~~~~~~~~~~~~~~~~~
2023-10-20T16:01:37.0146976Z Found 8 errors in 5 files (checked 78 source files)
2023-10-20T16:01:37.0358546Z typing: exit 1 (17.30 seconds) /home/runner/work/dandi-cli/dandi-cli> mypy dandi pid=2094

@yarikoptic
Copy link
Member Author

3.10 and 3.11 fails are known test_update_dandiset_from_doi . let's proceed

@yarikoptic yarikoptic merged commit 04e7c20 into master Oct 21, 2023
19 of 24 checks passed
@yarikoptic yarikoptic deleted the enh-location-folder branch October 21, 2023 00:55
Copy link

github-actions bot commented Nov 1, 2023

🚀 PR was released in 0.57.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged Python API released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

folder download needing trailing /
3 participants