Accept broken symlinks as path arguments of dandi validate - #1937
Open
CodyCBakerPhD wants to merge 2 commits into
Open
CodyCBakerPhD wants to merge 2 commits into
CodyCBakerPhD wants to merge 2 commits into
Conversation
`dandi validate` already handles annexed files whose content has not been
fetched (the broken symlinks of a DataLad dataset) according to
`--missing-file-content`: `error`, `skip`, or `only-non-data`. Those policies
were applied only when such a file was reached through its directory,
though: given directly on the command line, the file never got past argument
parsing, because `click.Path(exists=True)` follows the link and rejected it
with "does not exist". Check the path with `lexists()` instead, so that
dandi validate --missing-file-content=skip sub-01/sub-01.nwb
works the same as validating `sub-01/`, while paths that truly do not exist
are still rejected with the same error.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HFhMPs6vF5zyeHDvPTvRcA
CodyCBakerPhD
added this pull request to stack #1938
September 27, 2026 18:05
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## claude/docs-cli-options-sync #1937 +/- ##
================================================================
+ Coverage 78.30% 78.33% +0.02%
================================================================
Files 92 92
Lines 14068 14087 +19
================================================================
+ Hits 11016 11035 +19
Misses 3052 3052
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CodyCBakerPhD
removed this pull request from stack #1938
September 27, 2026 19:28
CodyCBakerPhD
added this pull request to stack #1940
September 27, 2026 19:29
CodyCBakerPhD
removed this pull request from stack #1940
September 27, 2026 20:17
CodyCBakerPhD
added this pull request to stack #1942
September 27, 2026 20:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another pre-PR splintered out of #1933 since it does actually affect the CLI today (granted, IDK why someone WOULD use the CLI in that way today on a datalad dataset, but they COULD)
dandi validatealready handles annexed files whose content has not been fetched (the broken symlinks of a DataLad dataset) according to--missing-file-content:error,skip, oronly-non-data. Those policies were applied only when such a file was reached through its directory, though: given directly on the command line, the file never got past argument parsing, becauseclick.Path(exists=True)follows the link and rejected it with "does not exist". Check the path withlexists()instead, so thatworks the same as validating
sub-01/, while paths that truly do not exist are still rejected with the same error.Claude-Session: https://claude.ai/code/session_01HFhMPs6vF5zyeHDvPTvRcA