Add dataarray size details to merge errors#106
Open
pragnyanramtha wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds per-target DataArray size details to the InvalidConfigException raised when _merge_dataarrays_by_target fails, making mismatched dimensions easier to diagnose. Also adds a unit test that triggers the error path and verifies the formatted output.
Changes:
- New helper
_format_dataarray_sizes_by_targetbuilds a multi-line summary of dims/sizes per target. - The merge failure exception message now includes the formatted size summary.
- Added
test_merge_error_includes_dataarray_sizes_by_targetcovering the new error content.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| mllam_data_prep/create_dataset.py | Adds size-summary helper and includes it in the merge-failure exception message. |
| tests/test_dataset.py | Adds a test asserting the new size details appear in the exception message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Problem summary
create_dataset reports a generic merge failure when target data arrays cannot align, but it does not show the per-target sizes that explain mismatched coordinates.
Root cause
The error path only included merged coordinate dumps, which make it hard to compare original input data arrays by target.
Files changed
Tests run
Risk notes
Low risk. The change only adds detail to an existing invalid-config exception path and keeps successful merge behavior unchanged.
Closes #105