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

Give validate command an --allow-any-path option #783

Merged
merged 2 commits into from
Oct 4, 2021
Merged

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Oct 4, 2021

Closes #780.

@jwodder jwodder added the minor Increment the minor version when merged label Oct 4, 2021
@codecov
Copy link

codecov bot commented Oct 4, 2021

Codecov Report

Merging #783 (f911a2c) into master (27dd3e7) will decrease coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #783      +/-   ##
==========================================
- Coverage   85.22%   85.05%   -0.18%     
==========================================
  Files          59       59              
  Lines        6039     6041       +2     
==========================================
- Hits         5147     5138       -9     
- Misses        892      903      +11     
Flag Coverage Δ
unittests 85.05% <100.00%> (-0.18%) ⬇️

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

Impacted Files Coverage Δ
dandi/cli/cmd_validate.py 85.00% <100.00%> (+0.38%) ⬆️
dandi/validate.py 53.48% <100.00%> (+0.54%) ⬆️
dandi/support/generatorify.py 0.00% <0.00%> (-16.10%) ⬇️
dandi/dandiarchive.py 82.23% <0.00%> (-1.53%) ⬇️
dandi/download.py 81.69% <0.00%> (-0.55%) ⬇️
dandi/dandiapi.py 92.46% <0.00%> (-0.20%) ⬇️
dandi/tests/test_metadata.py 100.00% <0.00%> (ø)
dandi/metadata.py 82.17% <0.00%> (+2.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27dd3e7...f911a2c. Read the comment docs.

@@ -28,7 +28,8 @@ def validate(paths, schema_version=None, devel_debug=False):
path, errors
errors for a path
"""
for path in find_dandi_files(paths):
filepaths = find_files(".*", paths) if allow_any_path else find_dandi_files(paths)
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, I thought to suggest adding exclude_datalad=True but since we already default to exclude_dotdirs = True I guess that doesn't matter.

@yarikoptic
Copy link
Member

need to think whether we would like to make validate consistent with upload and gain devel option --allow-any-path (so not just always do allow_any_path=True)... otherwise we are making validate and upload not behave analogously and that could confuse folks. WDYT?

@jwodder jwodder changed the title Make the validate command validate all files, not just .nwb's Give validate command an --allow-any-path option Oct 4, 2021
@jwodder
Copy link
Member Author

jwodder commented Oct 4, 2021

@yarikoptic Done.

@yarikoptic
Copy link
Member

Thank you @jwodder ... let's proceed with this and release to please dandischema testing with all the fixes we piled up.

@yarikoptic yarikoptic added the release Create a release when this pr is merged label Oct 4, 2021
@yarikoptic
Copy link
Member

note -- there is one failing test run (ubuntu-18.04, 3.7, dev-deps) with

=================================== FAILURES ===================================
_____________ test_download_000027_resume[0.210831.2033-<lambda>2] _____________
dandi/tests/test_download.py:90: in test_download_000027_resume
    download(url, tmp_path, get_metadata=False)
dandi/download.py:59: in download
    parsed_url = parse_dandi_url(urls[0])
dandi/dandiarchive.py:421: in parse
    new_url = cls.follow_redirect(url)
dandi/dandiarchive.py:534: in follow_redirect
    raise NotFoundError(url)
E   dandi.exceptions.NotFoundError: https://dandiarchive.org/dandiset/000027/0.210831.2033
------------------------------ Captured log call -------------------------------
DEBUG    dandi:dandiarchive.py:402 Parsing url https://dandiarchive.org/dandiset/000027/0.210831.2033

but it can't relate to this PR, so proceeding

@yarikoptic yarikoptic merged commit 52a87de into master Oct 4, 2021
@yarikoptic yarikoptic deleted the gh-780 branch October 4, 2021 16:53
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 release Create a release when this pr is merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NWB metadata errors not caught by validate
2 participants