Skip to content

Enhance dandiset metadata error messages#1790

Merged
yarikoptic merged 1 commit intomasterfrom
enh-lad-errors-dandiset
Feb 13, 2026
Merged

Enhance dandiset metadata error messages#1790
yarikoptic merged 1 commit intomasterfrom
enh-lad-errors-dandiset

Conversation

@yarikoptic-gitmate
Copy link
Collaborator

Improves dandiset metadata error messages with actionable hints for quick diagnosis and recovery.

Changes

  • Missing metadata: Now explains what's missing and suggests dandi download to re-download
  • No metadata record: Explains file may be empty/corrupted with recovery steps
  • Missing identifier: Clarifies required field structure in dandiset.yaml

Example Improvements

Before:

ValueError: No metadata record found in Dandiset

After:

ValueError: No metadata record found in Dandiset at /path/to/dandiset.
The 'dandiset.yaml' file may be empty or corrupted.
Use 'dandi download' to re-download the dandiset metadata.

Benefits

  • Users get specific guidance on how to fix issues
  • Reduces support burden by providing actionable hints
  • References specific commands users can run

Files Changed

  • dandi/dandiset.py

Testing

Verified with full test suite: 548 passed, 0 failed.

See commit: 092b1e5d

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Improve error messages in dandiset.py to provide actionable guidance:
- Add hint about using 'dandi download' when dandiset.yaml is missing
- Explain that metadata file may be empty or corrupted
- Clarify required 'identifier' field in metadata structure

These improvements help users quickly diagnose and fix common metadata issues.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@yarikoptic-gitmate yarikoptic-gitmate added enhancement New feature or request UX labels Feb 12, 2026
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.11%. Comparing base (a3dd9f9) to head (b964883).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
dandi/dandiset.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1790   +/-   ##
=======================================
  Coverage   75.11%   75.11%           
=======================================
  Files          84       84           
  Lines       11921    11921           
=======================================
  Hits         8954     8954           
  Misses       2967     2967           
Flag Coverage Δ
unittests 75.11% <0.00%> (ø)

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yarikoptic yarikoptic added the patch Increment the patch version when merged label Feb 13, 2026
@yarikoptic yarikoptic merged commit 2d10167 into master Feb 13, 2026
36 of 40 checks passed
@yarikoptic yarikoptic deleted the enh-lad-errors-dandiset branch February 13, 2026 21:18
Comment on lines +46 to +47
f"No dandiset at {path}. "
f"The directory does not contain a '{dandiset_metadata_file}' file. "
Copy link
Contributor

@CodyCBakerPhD CodyCBakerPhD Feb 13, 2026

Choose a reason for hiding this comment

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

Hmm mixed convention of printing paths

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

Labels

enhancement New feature or request patch Increment the patch version when merged UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants