-
Notifications
You must be signed in to change notification settings - Fork 449
fix: ilab taxonomy diff provides full error details when it fails #3220
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
Merged
Conversation
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
Signed-off-by: Bill Murdock <[email protected]>
nathan-weinberg
approved these changes
Mar 5, 2025
reidliu41
approved these changes
Mar 5, 2025
Contributor
|
@mergify backport release-v0.23 |
Contributor
✅ Backports have been createdDetails
|
6 tasks
mergify bot
added a commit
that referenced
this pull request
Mar 6, 2025
…ckport #3220) (#3221) In this change, ilab taxonomy diff provides the full error details when it fails instead of just the error message, which is often missing or lacking crucial detail. In one motivating example, we see the before output as: ``` Reading taxonomy failed with the following error: ``` and the after output as: ``` Reading taxonomy failed with the following error: ] Traceback (most recent call last): File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/instructlab/schema/taxonomy.py", line 403, in parse contents: Mapping[str, typing.Any] | typing.Any = yaml.safe_load(text) ^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/__init__.py", line 125, in safe_load return load(stream, SafeLoader) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/__init__.py", line 81, in load return loader.get_single_data() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/constructor.py", line 49, in get_single_data node = self.get_single_node() ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 36, in get_single_node document = self.compose_document() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 55, in compose_document node = self.compose_node(None, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 133, in compose_mapping_node item_value = self.compose_node(node, item_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 82, in compose_node node = self.compose_sequence_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 111, in compose_sequence_node node.value.append(self.compose_node(node, index)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 133, in compose_mapping_node item_value = self.compose_node(node, item_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 82, in compose_node node = self.compose_sequence_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 111, in compose_sequence_node node.value.append(self.compose_node(node, index)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 127, in compose_mapping_node while not self.check_event(MappingEndEvent): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/parser.py", line 98, in check_event self.current_event = self.state() ^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key if self.check_token(KeyToken): ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/scanner.py", line 115, in check_token while self.need_more_tokens(): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/scanner.py", line 152, in need_more_tokens self.stale_possible_simple_keys() File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/scanner.py", line 291, in stale_possible_simple_keys raise ScannerError("while scanning a simple key", key.mark, yaml.scanner.ScannerError: while scanning a simple key in "<unicode string>", line 62, column 9: merchandise, and VIP treatment a ... ^ could not find expected ':' in "<unicode string>", line 63, column 3: - context: | ^ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/bmurdock/git/ilab-taxo-diff/instructlab/src/instructlab/taxonomy/diff.py", line 88, in diff validate_taxonomy(taxonomy_path, taxonomy_base, yaml_rules) File "/Users/bmurdock/git/ilab-taxo-diff/instructlab/src/instructlab/utils.py", line 456, in validate_taxonomy warnings, errors = validate_taxonomy_file(file_path, yamllint_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/git/ilab-taxo-diff/instructlab/src/instructlab/utils.py", line 396, in validate_taxonomy_file taxonomy = parser.parse(file_path) ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/instructlab/schema/taxonomy.py", line 432, in parse raise TaxonomyReadingException from e instructlab.schema.taxonomy.TaxonomyReadingException ``` As you can see, the after behavior is messy but does tell you what when wrong and what line and character it went wrong at. **Checklist:** - [x] **Commit Message Formatting**: Commit titles and messages follow guidelines in the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary). - [ ] [Changelog](https://github.com/instructlab/instructlab/blob/main/CHANGELOG.md) updated with breaking and/or notable changes for the next minor release. - [ ] Documentation has been updated, if necessary. - [ ] Unit tests have been added, if necessary. - [ ] Functional tests have been added, if necessary. - [ ] E2E Workflow tests have been added, if necessary. <hr>This is an automatic backport of pull request #3220 done by [Mergify](https://mergify.com). Approved-by: nathan-weinberg Approved-by: courtneypacheco
Contributor
|
@mergify backport release-v0.24 |
Contributor
✅ Backports have been createdDetails
|
6 tasks
mergify bot
added a commit
that referenced
this pull request
Mar 6, 2025
…ckport #3220) (#3223) In this change, ilab taxonomy diff provides the full error details when it fails instead of just the error message, which is often missing or lacking crucial detail. In one motivating example, we see the before output as: ``` Reading taxonomy failed with the following error: ``` and the after output as: ``` Reading taxonomy failed with the following error: ] Traceback (most recent call last): File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/instructlab/schema/taxonomy.py", line 403, in parse contents: Mapping[str, typing.Any] | typing.Any = yaml.safe_load(text) ^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/__init__.py", line 125, in safe_load return load(stream, SafeLoader) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/__init__.py", line 81, in load return loader.get_single_data() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/constructor.py", line 49, in get_single_data node = self.get_single_node() ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 36, in get_single_node document = self.compose_document() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 55, in compose_document node = self.compose_node(None, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 133, in compose_mapping_node item_value = self.compose_node(node, item_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 82, in compose_node node = self.compose_sequence_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 111, in compose_sequence_node node.value.append(self.compose_node(node, index)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 133, in compose_mapping_node item_value = self.compose_node(node, item_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 82, in compose_node node = self.compose_sequence_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 111, in compose_sequence_node node.value.append(self.compose_node(node, index)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/composer.py", line 127, in compose_mapping_node while not self.check_event(MappingEndEvent): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/parser.py", line 98, in check_event self.current_event = self.state() ^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key if self.check_token(KeyToken): ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/scanner.py", line 115, in check_token while self.need_more_tokens(): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/scanner.py", line 152, in need_more_tokens self.stale_possible_simple_keys() File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/yaml/scanner.py", line 291, in stale_possible_simple_keys raise ScannerError("while scanning a simple key", key.mark, yaml.scanner.ScannerError: while scanning a simple key in "<unicode string>", line 62, column 9: merchandise, and VIP treatment a ... ^ could not find expected ':' in "<unicode string>", line 63, column 3: - context: | ^ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/bmurdock/git/ilab-taxo-diff/instructlab/src/instructlab/taxonomy/diff.py", line 88, in diff validate_taxonomy(taxonomy_path, taxonomy_base, yaml_rules) File "/Users/bmurdock/git/ilab-taxo-diff/instructlab/src/instructlab/utils.py", line 456, in validate_taxonomy warnings, errors = validate_taxonomy_file(file_path, yamllint_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/git/ilab-taxo-diff/instructlab/src/instructlab/utils.py", line 396, in validate_taxonomy_file taxonomy = parser.parse(file_path) ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bmurdock/.pyenv/versions/bmurdock-pyenv-virtualenv/lib/python3.11/site-packages/instructlab/schema/taxonomy.py", line 432, in parse raise TaxonomyReadingException from e instructlab.schema.taxonomy.TaxonomyReadingException ``` As you can see, the after behavior is messy but does tell you what when wrong and what line and character it went wrong at. **Checklist:** - [x] **Commit Message Formatting**: Commit titles and messages follow guidelines in the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary). - [ ] [Changelog](https://github.com/instructlab/instructlab/blob/main/CHANGELOG.md) updated with breaking and/or notable changes for the next minor release. - [ ] Documentation has been updated, if necessary. - [ ] Unit tests have been added, if necessary. - [ ] Functional tests have been added, if necessary. - [ ] E2E Workflow tests have been added, if necessary. <hr>This is an automatic backport of pull request #3220 done by [Mergify](https://mergify.com). Approved-by: nathan-weinberg Approved-by: courtneypacheco
|
@jwm4 thanks for your help with this (Y) |
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.
In this change, ilab taxonomy diff provides the full error details when it fails instead of just the error message, which is often missing or lacking crucial detail. In one motivating example, we see the before output as:
and the after output as:
As you can see, the after behavior is messy but does tell you what when wrong and what line and character it went wrong at.
Checklist:
conventional commits.