Include populated_from in TransformationError messages#184
Merged
amc-corey-cox merged 1 commit intomainfrom Apr 1, 2026
Merged
Include populated_from in TransformationError messages#184amc-corey-cox merged 1 commit intomainfrom
amc-corey-cox merged 1 commit intomainfrom
Conversation
Add class_populated_from and slot_populated_from fields so error messages show source context: "slot_derivation=value_decimal (from phv00191041)" instead of just "slot_derivation=value_decimal". Closes #183 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves transformation diagnostics by including source mapping context (populated_from) in TransformationError string output, helping curators identify the originating source table/column directly from error messages (closes #183).
Changes:
- Added
class_populated_fromandslot_populated_fromfields toTransformationError. - Updated
TransformationError.__str__to append(from ...)to derivation segments when available. - Passed populated-from context when constructing
TransformationErrorinObjectTransformer.map_object.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/linkml_map/transformer/errors.py |
Extends TransformationError with populated-from context and formats it into __str__. |
src/linkml_map/transformer/object_transformer.py |
Supplies class_deriv.populated_from and slot_derivation.populated_from when wrapping exceptions as TransformationError. |
tests/test_transformer/test_continue_on_error.py |
Adds unit tests covering full and partial populated-from inclusion in TransformationError.__str__. |
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.
Summary
Closes #183
Adds source context to
TransformationErrorso curators can identify which source table/column caused the error without opening the YAML spec.Before
After
Changes
class_populated_fromandslot_populated_fromfields toTransformationError__str__to append(from ...)when populated_from is presentmap_objectTest plan
🤖 Generated with Claude Code